C program to check whether character is lowercase or not using ASCII values 1

C program to check whether character is lowercase or not using ASCII values

#include 

int main()
{
  char Ch;
  
  printf("\n Please Enter any character\n");
  scanf("%c", &Ch);

  if (Ch >= 97 && Ch <= 122)
   {  
     printf ( "\nEntered character is lowercase alphabet") ;
   }
  else
   {
     printf("\nEntered character is Not lowercase alphabet");
   }  
}

Here is what the above code is Doing:
1. We are taking a character as input from the user.
2. We are checking whether the character is lowercase or not.
3. If the character is lowercase, then the program will print the message "Entered character is lowercase alphabet".
4. If the character is not lowercase, then the program will print the message "Entered character is Not lowercase alphabet".

Similar Posts