Advertisement
Tahamina_Taha

All arithmetic operators

Aug 17th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. // All arithmetic operators
  4. int main()
  5. {
  6.     int a,b,result;
  7.     printf(" Enter the value of a  and b : \n");
  8.     scanf(" %d %d",&a,&b);
  9.  
  10.     result = a+b;
  11.     printf("a+b = %d \n",result);
  12.     result = a-b;
  13.     printf("a-b = %d \n",result);
  14.     result = a*b;
  15.     printf("a*b = %d \n",result);
  16.     result= a/b;
  17.     printf("a/b = %d \n",result);
  18.     result= a%b;
  19.     printf("Remainder when a divided by b = %d \n",result);
  20.      return 0;
  21.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement