1.

Write a c++ program to compute area to triangle and circle by overloading the area () function

Answer»

e#include # DEFINE _PI_         3.14159265// AREA of trianglefloat area(int base, int height) {    return 0.5*base*height;}// area of circlefloat area(int radius) {  return _PI_*radius*radius}void main() {    float radius, base, height;    clrscr();   // CIRCLE   cout<<"ENTER radius of the circle";   cin>>radius;   cout<<"Area of Circle: "<>base;    cout<<"Enter height of the triangle";    cin>>height;      cout<<"Area of Triangle: "<



Discussion

No Comment Found