Thursday, 26 January 2012

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

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void 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();
}


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

No comments:

Post a Comment