CJCoding With Joseph
15free / daySign inCreate account

Add Two Inputs Using Only Their Pointers

Read two integers into a and b, then declare int pointers pa and pb holding their addresses. Print the sum and the difference using ONLY the dereferenced pointers (*pa and *pb) - the names a and b must not appear inside the printf calls.

Input: two integers separated by a space.

For the input 3 4 print exactly the output shown in Expected Output.

Difference means *pa - *pb (first number minus second).

Expected Output:

Sum: 7
Difference: -1

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

Hints4 available
Topics:
Pointers
📥 Auto-Input:
3 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.