fork(2) download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. char c;
  5. scanf("%c",&c);
  6. switch (c){
  7. case 'A':case 'E':case 'I':
  8. case 'O':case 'U':case 'Y':
  9. printf("%c is uppercase\n", c);
  10. case 'a':case 'e':case 'i':
  11. case 'o':case 'u':case 'y':
  12. printf("%c is a vowel\n",c); break;
  13. default:
  14. if (c<='z' && c>='A')
  15. printf("%c is a consonant\n", c);
  16. else printf("%c is not a letter\n", c);
  17. if (c<='Z' && c>='A')
  18. printf("%c is uppercase\n", c);
  19. break;
  20. }
  21. return 0;
  22. }
  23.  
stdin
d
compilation info
prog.c: In function ‘main’:
prog.c:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
stdout
d is a consonant