Advertisement
Guest User

Untitled

a guest
May 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. char ch;
  6. int test, i;
  7. printf("Enter Test Case: ");
  8. scanf("%d", &test);
  9.  
  10.  
  11. for(i = 0; i< test; i++)
  12. {
  13. printf("\nEnter any character: ");
  14. scanf(" %c", &ch);
  15. /* Alphabet check */
  16. if((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))
  17. {
  18. printf("%c is alphabet.\n", ch);
  19. }
  20.  
  21. /* Digit check */
  22. else if(ch >= 48 && ch <= 57)
  23. {
  24. printf("%c is digit.\n", ch);
  25. }
  26.  
  27. /* Special Character check */
  28. else
  29. {
  30. printf("%c is special character.\n", ch);
  31. }
  32.  
  33. }
  34.  
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement