Question: This is C programming, Declare a triangle struct with two floats as data members. One float will be for the height and one for the

This is C programming,

Declare a triangle struct with two floats as data members. One float will be for the height and one for the base.

Write a function that takes a triangle struct (struct triangle) and returns a float. The function should calculate and return the area of the triangle. The formula is area = (1/2) * base * height.

In main, define a triangle struct and prompt the user for two floats (base and height). Call the function and print the area in main.

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 Databases Questions!