#include<stdio.h>
#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
#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