← Back to Structs
Question 401
Reflect a Point Across the Origin
Reflect a Point Across the Origin
Astruct Pointstarts atx = 3,y = -5. Reflect it across the origin by negating both fields, then print the new coordinates separated by a space (see Expected Output). Modify the struct fields in place; do not just print-p.xwithout changing them. There is no trailing newline.
Expected Output:
-3 5= newline. No newline after the last line.
Hints2 available
Sign in to use hintsTopics:
Structs
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.