fork download
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char s[5];
  6. clrscr();
  7. printf("\n Enter any operator:");
  8. gets(s);
  9. switch(s[0])
  10. {
  11. case'>': if(s[1]=='=')
  12. printf("\n Greater than or equal");
  13. else
  14.  
  15. break;
  16.  
  17. printf("\n Greater than");
  18. case'<': if(s[1]=='=')
  19. printf("\n Less than or equal");
  20. else
  21.  
  22. break;
  23.  
  24. printf("\nLess than");
  25. case'=': if(s[1]=='=')
  26. printf("\nEqual to");
  27. else
  28.  
  29. break;
  30.  
  31. printf("\nAssignment");
  32. case'!': if(s[1]=='=')
  33. printf("\nNot Equal");
  34. else
  35.  
  36. break;
  37.  
  38. printf("\n Bit Not");
  39. case'&': if(s[1]=='&')
  40. printf("\nLogical AND");
  41. else
  42. printf("\n Bitwise AND");
  43. 4
  44. break;
  45. case'|': if(s[1]=='|')
  46. printf("\nLogical OR");10
  47. else
  48.  
  49. break;
  50.  
  51. printf("\nBitwise OR");
  52. case'+': printf("\n Addition");
  53. break;
  54. case'-': printf("\nSubstraction");
  55. break;
  56. case'*': printf("\nMultiplication");
  57. break;
  58. case'/': printf("\nDivision");
  59. break;
  60. case'%': printf("Modulus");
  61. break;
  62. default: printf("\n Not a operator");
  63. }
  64. getch();
  65. }
  66.  
Success #stdin #stdout #stderr 0.02s 6984KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/KLWYAE/prog:65:2: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit