Advertisement
mhrabbi

All arithmetic operations (Prob 1)

Jun 21st, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.  
  5.  
  6. int first,second,sum,sub,mul,div;
  7. float mod;
  8.  
  9. printf("Enter two number \n");
  10. scanf("%d %d",&first , &second);
  11.  
  12.  
  13.  
  14. sum= first+second;
  15. sub= first-second;
  16. mul= first*second;
  17. div= first/second;
  18. mod= first%second;
  19.  
  20. printf("Sum is %d\n",sum);
  21. printf("Sub is %d\n",sub);
  22. printf("Mul is %d\n",mul);
  23. printf("Div is %d\n",div);
  24. printf("Mod is %f\n",mod);
  25.  
  26. return 0;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement