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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!