Circle Struct: Radius and Diameter
easyQuestion 242Define a struct type named Circle with a single integer field radius. Create a Circle with radius 5, then print its radius and its diameter (radius times 2) exactly as: Radius: 5, Diameter: 10 followed by a newline. This shows that a struct can hold just one field, and that you can derive new values from it.
Expected output
Radius: 5, Diameter: 10= newline. The output ends with a newline, so print one after the last line.
Hints3 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.