Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 5 HW Spring 2017 v1
//gcc 5.4.0 #include <stdio.h> #include <ctype.h> //Start Program //Char a; //Int x; //If a is letter //If a is a vowel //X=2 //If a is a consonet // X=1 //Else if a is a digit // X=3 // Else if a is a special character // X=4 // Else // X=5 //Switch (x) // Case 1: // Print character is a consonant // Break; // Case 2: // PRINT character is a vowel // Break; // Case 3: // Print Character is a digit // Break; // Case 4: // Print Character is a symbol // Break; // Default: // PRINT Character cannot be read //End Program int main(void){ char a; int x; scanf("%ch",&a); if(ispunct(a)){ x=4; } else{ x=5; } if(isalnum(a)){ if((a=='A')||(a=='a')||(a=='e')||(a=='E')||(a=='I')||(a=='i')||(a=='O')||(a=='o')||(a=='U')||(a=='u')||(a=='Y')||(a=='y')){ x=2; } else if(isdigit(a)){ x=3; } else{ x=1; } } printf("%d\n",x); switch (x){ case 1: printf("Character is a consonant"); break; case 2: printf("character is a vowel"); break; case 3: printf("Character is a digit"); break; case 4: printf("Character is a symbol"); break; default: printf("Character cannot be read"); break; } }
run
|
edit
|
history
|
help
0
c. new one
detonadisimo
1233333
8 trajo semal 4
150116_OrdenMatriz
tyiy
variable number of arguments
Area
CS HW2
linear_search.c