← Back to Structs
Question 236
Point Struct: Store and Print Coordinates
Point Struct: Store and Print Coordinates
Define a struct type named Point that has two integer fields, x and y. Inside main, create one Point variable, set its x field to 3 and its y field to 7, then print it exactly as: Point: (3, 7) followed by a newline. This is the most basic struct task: declare the type, set the fields with the dot (.) operator, and print them.
Expected Output:
Point: (3, 7)= 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.