Program : Write program to read and print alphabet Entered by the User
Please type one alphabet : A
The alphabet you entered is : A
This program fail at two points
- It should be print only 26 English Letter A to Z
- It shouldn't print numeric value 1 to 0
- It shouldn't print symbol . @ # % & * ..etc
C:
#include <stdio.h>
int main(void)
{
/* Decleare variable to store character */
char alphabet;
/* Type alphabet */
printf ("Please type one alphabet : ");
/*Read the alphabet Entered by the User */
scanf ("%c", &alphabet);
/* Show The alphabet entered */
printf ("The alphabet you entered is : %c", alphabet);
return 0;
}
The alphabet you entered is : A
This program fail at two points
- If user type numeric value it show numeric value
- if user type any symbol it show symbol