C Programming Tutorial

 
 
 
 

Image

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

void main(){
     char ch;
     clrscr();
     while(1){
    printf(\"\\nEnter ZERO to Terminate \\n\");
    printf(\"Enter any character : \");
    scanf(\"%c\",&ch);
    if(ch==\'0\')
       break;
    else if(isspace(ch))
         printf(\"\\nCharacter is a Space\\n\");
    else if(isdigit(ch))
         printf(\"\\nCharacter is a Digit\\n\");
    else if(isalpha(ch))
         printf(\"\\nCharacter is a Alphabet and it\'s uppercase is %c\\n\",toupper(ch));
    else if(isalnum(ch))
         printf(\"\\nCharacter is a Alphanumeric\\n\");
    else
         printf(\"\\nCharacter is a %c\\n\",ch);
    getch();
      }
}[/Code]

 
 
Didn't find what you were looking for? Find more on Program to display entered character in capital letter