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
Heres a description of how you can write a C program to achieve the specified tasks include Define t... View full answer
Get step-by-step solutions from verified subject matter experts
