PROGRAM TO FIND AREA OF TRIANGLE, CIRCLE AND SQUARE USING C++ LANGUAGE

 #include<iostream.h>

#include<conio.h>

void main()

{

        int choice;

        float l,b,h,result,r;

        count<<"Main Menu: <<"\n";

        count<<"1.Area Of Triangle"<<"\n";

        count<<"2.Area Of Circle"<<"\n";

        count<<"3.Area Of Square"<<"\n";

        count<<"Enter Your Choice(1-3) :";

        cin>>choice;

        switch(choice)

        {

            case1:

            {

                count<<"\n"<<"Enter base and height of triangle";

                cin>>b>>h;

                result=0.2*b*h;

                cout<<"The Area Of Triangle Is:"<<result<<"\n";

                break;

            }

            case2:

            {

                cout<<"Enter the Radius Of Circle:";

                cin>>r;

                result=3.14*r*r;

                cout<<"Area Of Circle Is:"<<result<<"\n";

                break;

            }

            case3;

            {

                cout<<"Enter the side:";

                cin>>l;

                result=l*l;

                cout<<Area Of Square Is:""<<result<<"\n";

                break;

            }

    }

}


Comments

Popular posts from this blog

PROGRAM IN C++ FOR A FUNCTION: f(x)=(x*x + 1.5x+5)/(x-3) for x=-10 to 10 , x should have the values from -10,-8,-6,..........10.

PROGRAM TO ACCEPT A NUMBER AND DISPLAY THE TABLE OF THAT NUMBER IN C++ LANGUAGE