Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------------------------------------
- // hw1a.c
- //
- // Common arithmetic operators
- //
- // Group: 9 study assistant Manuel Menzinger
- //
- // Authors: Matthias Lehner 1331444
- //
- // Latest Changes: 21.10.2014 (by Matthias Lehner)
- //-----------------------------------------------------------------------------
- //
- #include <stdio.h>
- int main()
- {
- int sum = 1 + 2 + 3;
- int product = 4 * 5 * 6;
- int lastdigit = 7;
- int result = ++product - sum++;
- result = result * sum;
- int intdiv = result / ++lastdigit;
- int rem = result % lastdigit;
- float decdiv = result / (float)lastdigit;
- printf("Result = %i\n", result);
- printf("Integer division = %i\n", intdiv);
- printf("Remainder = %i\n", rem);
- printf("Division = %.2f\n", decdiv);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement