C program to check character is lowercase or not without using function

C program to check character is lowercase or not without using function:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().

#include<stdio.h>
main()
{
   char ch;
   printf("Enter The Character :\n");
   scanf("%c",&ch);

   if(ch>='A' && ch<='Z')
    {
      printf("Character is not in LowerCase");
    }
   else if(ch>='a' && ch<='z')
    {
      printf("Character is in Lowercase");
    }
   else
    {
      printf("Non alphabet character");
    }
}

OUTPUT:

Enter The Character :
b
Character is in Lowercase

Enter The Character :
B
Character is not in LowerCase

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.