Programming for Problem Solving

GTU Practical 11

11. Write a C program to check whether the entered character is a capital, small letter, digit or any special character.
#include<stdio.h>  ( this applies in the given code )

#include

int main() {
char ch;
printf(“Enter Any Character: “);
scanf(“%c”, &ch);

printf(ch >= ‘0’ && ch = ‘A’ && ch = ‘a’ && ch <= 'z' ? "Small Letter" : "Special Character"); return 0; }

OUTPUT

Enter Any Character: 5
Digit

GTU STUDY