Question: a. Write function that reads hight and the base and calulate volum the triangle object . Hint: volum= *hight* base. B. In main: Define

a. Write function that reads hight and the base and calulate volum the triangle object .

Hint: volum= ½ *hight* base.

B. In main:

  • Define object of type triangle (triObj).
  • Define Pointer object of type triangle (ptr).
  • Let ptr points on triObj.
  • Call function read for object triObj.
  • Print the infotmation of the triObj using pointer ptr. (base,hight ,volum)


 Suppose you have following code: [5 marks]

struct triangle

{

int hight;

int base;

double volum;

};


Step by Step Solution

3.45 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a description of how you can write a C program to achieve the specified tasks include Define t... View full answer

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