Rectangle Struct: Compute the Perimeter
easyQuestion 240Define a struct type named Rectangle with integer fields width and height. Create a Rectangle with width 7 and height 3, then print its perimeter, which is 2 times (width plus height), exactly as: Perimeter: 20 followed by a newline. Remember to add width and height first, then multiply by 2.
Expected output
Perimeter: 20= newline. The output ends with a newline, so 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.