← Back to Structs
Question 239
Point Struct: Sum of Coordinates
Point Struct: Sum of Coordinates
Define a struct type named Point with integer fields x and y. In main, create a Point, set x to 6 and y to 9, then print the sum of the two coordinates exactly as: Sum: 15 followed by a newline. This practices reading two struct fields and adding them together.
Expected Output:
Sum: 15= newline. The output ends with a newline — print one after the last line.
Hints4 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.