Identify case of character

Q. Write a C program to accept a character value form user and find out, character is capital letter or small letter.


/*c program to find out entered character is capital or small letter*/
int main()
 char ch;
 printf("Enter any character : ");
 scanf("%ch", &ch);
 if(ch>='A' && ch<='Z')
    printf("You entered capital letter!");
 else if(ch>='a' && ch<='z')
    printf("You entered small letter!");
    printf("You entered invalid character!");

 return 0;


Screen shot for identify entered letter is capital or small

No comments:

Post a Comment