Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a = 5, b = 10, answer = 0;
- answer = ++a * b; //added one to a AFTER the calculation
- printf("a:%d \t b:%d \t answer:%d \n", a, b, answer);
- //reset variables
- a = 5, b = 10, answer = 0;
- answer = a++ * b; //added one to a BEFORE the calculation
- printf("a:%d \t b:%d \t answer:%d \n", a, b, answer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement