Subscribe

RSS Feed (xml)

Saturday, October 3, 2009

Write a program in c to accept any character and check whether the given character is capital or small using Ctype.h library file

// Using Library functions like isupper( ) or islower( )

#include(stdio.h) //note use '<' & '>' in place of '(' & ')'
#include(conio.h)
#include(ctype.h)
int main( )
{
char ch;
clrscr( );
printf("Enter any alphabet:");
scanf("%c", &ch);
if(isupper(ch))
printf("\nGiven Alphabet is in Upper Case");
else
printf("\nGiven Alphabet is in Lower case");
getch( );
return 0;
}

Output:- Enter any alphabet: a
Given Alphabet is in Lower case

No comments:

Post a Comment