Character handling

Write a Program to accept a character & find whether capital/small case,digit/special case letter

#include <stdio.h>
#include <conio.h>

void main()
{
char ch;
clrscr();
printf("enter any character");
scanf("%c",&ch);
if((ch >='A')&&(ch<='Z'))
  printf("capital case letter");
else if((ch>='a')&&(ch<='z'))
  printf("lower case letter");
else if((ch>='1')&&(ch<='9'))
  printf("digit");
else
  printf("Special symbol");
getch();
}

No comments:

Post a Comment

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number