CJCoding With Joseph
15free / daySign inCreate account

Complete void sumAndDiff(int a, int b, int *sum, int *diff) so it stores a + b in the int that sum points at, and a - b in the int that diff points at. The difference is a - b, so it can be negative.

main is already written: it reads two integers, calls the function, and prints both results.

For the input: 8 4

Print exactly what is shown in Expected Output.

Expected output

Sum: 12
Difference: 4

= newline. The output ends with a newline, so print one after the last line.

Hints3 available
Topics
Pointers
Auto-input
8 4\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.