GTU PPS Program - 11

11. Write a C program to check whether the entered character is capital, small letter, digit or any special character.

#include<stdio.h>
#include<conio.h>
int main()
{
    char ch;
    printf("\nPress any key : ");
    ch=getchar();
    if(ch>='A' && ch<='Z')
    printf("\nentered character is capital letter");
    else if(ch>='a'&& ch<='z')
        printf("\nEntered character is small letter");
    else if(ch>='0'&& ch<='9')
        printf("\nEntered character is digit");
    else
        printf("\nEntered character is special character");
    getch();
    return 0;
}

Sample output

Comments

YouTube

Popular posts from this blog

Example Programs using Real world Classes and Objects

GTU OOP Program - 8