Write a C program to input any alphabet and check whether it is upper case or lower case alphabet.

Code:-

#include<stdio.h>
int main()
{
char ch;
printf(“Enter a charactern); //input
scanf(“%c”,&ch);
if(ch>=65 && ch<=90) //logic
{
printf(“Character is uppercasen “);
}
else if(ch>=97 && ch<=122)
{
printf(“character is lowercase alphabetn”);
}
return 0;
}

Output:-

Enter a character
a
character is lowercase alphabet



Recommended Post:

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

Key points:-

 MCQs:-

Leave a Reply

Your email address will not be published.