Question: Create a struct called dimensions that has the following data items: int height int width Create a function called addDimensions that is passed 2 dimensions

Create a struct called dimensions that has the following data items: int height int width Create a function called addDimensions that is passed 2 dimensions structs as parameters. The function adds the 2 dimensions of both dimensions structs and stores the result into a new dimensions struct. The function returns the new dimensions struct with the added values. In main(), use scanf to get the values for the two dimensions structs from the user. Call the addDistance function to add their dimensions together and return a new struct with the added values back to main(). Finally, print the values of the 3 dimensions struct that shows the function added the dimensions of the structs. Output example: Enter the height of the first struct: 50 Enter the width of the first struct: 75 Enter the height of the second struct: 30 Enter the width of the second struct: 65 Struct 1 Height = 50 Struct 1 Width = 75 AR Struct 2 Height = 30 Question 1 Enter the height of the first struct: 50 Enter the width of the first struct: 75 Enter the height of the second struct: 30 Enter the width of the second struct: 65 Struct 1 Height = 50 Struct 1 Width = 75 Struct 2 Height = 30 Struct 2 Width = 65 New Struct Height = 80 New Struct Width = 140
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
