Nusrat_Ullah

ananta 2A

Dec 18th, 2020
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int A,B,N,res;
  5.     char op;
  6.     scanf("%d",&N);
  7.     while(N--){
  8.         scanf("%d%c%d",&A,&op,&B);
  9.         if(op=='+'){
  10.             res=A-B;
  11.         }
  12.         else if(op=='-'){
  13.             res=A*B;
  14.         }
  15.         else if(op=='*'){
  16.             res=A+B;
  17.         }
  18.         else if(op=='/'){
  19.             res=A/B;
  20.         }
  21.         printf("%d\n",res);
  22.     }
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment