Search Your Keyword

A One Massage for users

C Program BD say you

Hi, If you are new in our blog and to get support about C program, than you must select your level from right side in this blog.Such as, If you want to learn than you select Entry Level for learning and If you are known the basic of C program than you select Solution Level.


Saturday, September 14, 2019

Q9. Write a program that enters a character and determine whether the inputted character is an alphabet or digit or any other special character.

Find out inputted character is an alphabet or digit or any other special character:-
#include<stdio.h>
#include<conio.h>

void main()
{
char ch;
clrscr();

printf("Press any key:-");
ch = getchar();


if(isalpha(ch)>0)
{
printf("The character is a letter.");
}
else if(isdigit(ch)>0)
{
printf("The character is a digit.",);
}
else
{
printf("The character is not a alphanumeric");
}
getch();
}

Find out inputted character is an alphabet or digit or any other special character


No comments:

Post a Comment