Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
65
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 c;
  6. int output,d;
  7. {
  8. printf("Podaj znak: ");
  9. c=getchar();
  10. d=(int)c;
  11.  
  12.  
  13. if((d>=48) && (d<=57))
  14. output = 0;
  15. else if((d>=40) && (d<=41))
  16. output = 1;
  17. else if((d>=42) && (d<=47))
  18. output = 2;
  19. else
  20. output = 3;
  21.  
  22. switch(output)
  23. {
  24. case 0:
  25. printf("cyfra\n");
  26. break;
  27. case 1:
  28. printf("nawiasy\n");
  29. break;
  30. case 2:
  31. printf("znaki dzialan matematycznych\n");
  32. break;
  33. case 3:
  34. printf("inny znak\n");
  35. break;
  36. }
  37. }
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement