41. WAP to scan a character from the user, display that character and its ASCII value only if the given input is small alphabet.
#include<stdio.h>
void
main()
{
char ch;
printf("Enter the character :
\n");
scanf("%c",&ch);
//if(ch>=97 && ch<=122)
if(ch>='a' && ch<='z')
printf("ch=%c and its
ASCII = %d\n",ch,ch);
}
Comments
Post a Comment