donmike25

ecp1016 tutorial 2(1)

Jun 27th, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int x,y,sum,difference,product,quotient,remainder;
  6.     printf("Enter first number:\n");
  7.     scanf("%d",&x);
  8.     printf("Enter second number:\n");
  9.     scanf("%d",&y);
  10.     sum = x+y;
  11.     difference = x-y;
  12.     product = x*y;
  13.     quotient = x/y;
  14.     remainder = x%y;
  15.     printf("Sum of x and y value is %d\n", sum);
  16.     printf("Difference of x and y value is %d\n", difference);
  17.     printf("Product of x and y value is %d\n", product);
  18.     printf("Quotient of x and y value is %d\n",quotient);
  19.     printf("Remainder of x and y value is %d\n",remainder);
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment