Virajsinh

A_PRM_12

Oct 7th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. /* Write a program which takes an input from the user and then
  2. checks whether it is a number or a character. If it is a character,
  3. determine whether it is in upper case or lower case. */
  4.  
  5. /* If Program not Saved Compile Program Show Prototype Error
  6. Include This Header File --> #include<ctype.h> */
  7.  
  8. #include<conio.h>
  9. #include<conio.h>
  10.  
  11. void main()
  12. {   char ch, *c;
  13.     clrscr();
  14.     c=&ch;
  15.  
  16.     printf("\n Check Input Value is Number And Character (Upper And Lower)");
  17.     printf("\n Enter Character : ");
  18.     scanf("%c", &ch);
  19.  
  20.     if (isdigit(*c))
  21.     {
  22.             printf("\n Enter Value %c is Number", ch);
  23.     }
  24.     else if (isalpha(*c))
  25.     {
  26.             printf("\n Enter Value %c is Alphabat", ch);
  27.             if (isupper(*c))
  28.             {
  29.                 printf("\n Enter Value %c is Upper",ch);
  30.             }
  31.             else
  32.             {
  33.                 printf("\n Enter Value %c is Lower");
  34.             }
  35.     }
  36.  
  37.     getch();
  38. }
Add Comment
Please, Sign In to add comment