C++ program to find area of rectangle and triangle using function by using height h and width w
Answers
Answered by
0
#include <iostream>
using namespce std ;
int Rectangle(int b , int h )
{
int area = b*h;
return(area);
}
int Triangle(int b , int h)
{
int area = 0.5 * b * h;
return(area);
}
int main ()
{
int b;
int h;
int arear ; int areat
cout << "base and height : ";
arear = Rectangle(b , h);
areat = Ttiangle(b , h);
cout << area << endl << areat << endl;
return 0 ;
}
Similar questions
Computer Science,
29 days ago
Physics,
29 days ago
World Languages,
29 days ago
English,
1 month ago
Math,
1 month ago
Geography,
8 months ago
Math,
8 months ago