← Back to Pointers
Question 430
Add Two Inputs Using Only Their Pointers
Add Two Inputs Using Only Their Pointers
Read two integers intoaandb, then declareintpointerspaandpbholding their addresses. Print the sum and the difference using ONLY the dereferenced pointers (*paand*pb) - the namesaandbmust not appear inside the printf calls. Input: two integers separated by a space. For the input3 4print 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
Sign in to use hintsTopics:
Pointers
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.