Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to input a character and check if it's upper case, lower case or a digit.
- #include<stdio.h>
- #include<conio.h>
- #include<ctype.h>
- void main()
- {
- char ch;
- clrscr();
- printf("Enter a character: ");
- scanf("%c", &ch);
- if(isupper(ch))
- printf("The character %c is upper case.", ch);
- else if(isdigit(ch))
- printf("The character %c is a digit.", ch);
- else if(islower(ch))
- printf("The character %c is lower case.", ch);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment