// Method 1: Without Library functions
//using ASCII values
#include(stdio.h) //note use '<' & '>' in place of '(' & ')'
#include(conio.h)
int main( )
{
char ch;
clrscr( );
printf("Enter the any alphabet:");
scanf("%c ", &ch);
if(ch>= 65 && ch<=90) // or if(ch>='A' && ch<='Z')
printf("\nGiven Alphabet is in Upper case");
else
printf("\nGiven Alphabet is in Lower case");
getch( );
return 0;
}
Output:- Enter the any alphabet: A
Given Alphabet is in Upper case
Note :- ASCII value of 'A'=65 and 'Z'= 90
No comments:
Post a Comment