‘C’ program to check if character is uppercase or lowercase.

C File =>


/* Write a ‘C’ program to accept a character and check if it is uppercase 
or lowercase */

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

int main() 
{
        char ch;

        printf("\n Enter character : ");
        scanf("%c",&ch);

        if(islower(ch))
              printf("\n Lower case character..");
        else if(isupper(ch))
              printf("\n Upper case character..");
       else
              printf("\n Invalid input...");
      return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.