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
Step: 1
Heres a description of how you can write a C program to achieve the specified tasks include Define t...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
C++ Primer Plus
Authors: Stephen Prata
6th Edition
978-0321776402, 0321776402
Students also viewed these Algorithms questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App