Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
22nd HW Switchv0.24
//gcc 5.4.0 #include <stdio.h> #include <ctype.h> int main(void) { char myChar; printf("Please enter a single Character:\n"); scanf("%c\n",&myChar); printf("The entered character is:%c\n", myChar); if(isspace(myChar)) { myChar=1; } else if (ispunct(myChar)) { myChar=2; } else if (iscntrl(myChar)) { myChar=3; } else if (isalnum(myChar)) { myChar=4; } else if (isdigit(myChar)) { myChar=5; } else if (isalpha(myChar)) { myChar=6; } else if (islower(myChar)) { myChar=7; } else { myChar=8; } switch(myChar) { case 1: printf("You have entered a space character\n"); break; case 2: printf("You have entered a punctuation character\n"); break; case 3: printf("You have entered a control character.\n"); break; case 4: printf("You have entered an alphanumeric character AND "); case 5: printf("Your character is a digit\n"); case 6: case 7: printf("Your character is an lower case alphabetic character"); default: printf("Your character is an Upper case alphabetic character"); break; } return 0; } //islower(myChar)
run
|
edit
|
history
|
help
0
light blue zoda
HW22
A_141205_CadenaValorNumerico
150115_EsMatrizOrdenada
Incometax problem v0.1
A_141211_mayor
Day Of The Programmer
C_141113_dividirRestasSucesivas
factorial
Array pass effect