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();
}
#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