This C program take in a Key Press and displays if its a number , character (small or Big) or Special character. This program is part of Mumbai University MCA Colleges C programs MCA Sem 1.
This program uses the concepts of ASCII values on the keyboard press.
void main()
{
char c,ans;
do{
fflush(stdin);
printf("Enter character");
scanf("%c",&c);
if(c>=65 && c<=90)
{
printf("Entered character is capital letter");
}
if(c>=97 && c<=122)
{
printf("SMALL LETTERS");
}
if(c>=48 && c<=57)
{
printf("DIGIT");
}
if(c>=32 && c<=47)
{
printf("SPECIAL CHARACTER");
}
fflush(stdin);
printf("do u want to continue y/n");
scanf("%c",&ans);
}
while(ans!='n');
}
Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.
Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.
No comments:
Post a Comment