**Problem:-**Write A C++ To Calculate Area Of Circle Rectangle And Triangle Using Switch Case or C++ Program to Compute Area of Shapes using Switch Case or c++ program to find area of circle using functions or c++ program to find area of rectangle and circle using class and object or c++ program to find area of rectangle using switch case or C Program to Find the Areas of Different Geometrical Figures or area of a triangle with switch statements.

**Check This:-**Hacker rank solution for Strings, Classes, STL, Inheritance in C++.

**Logic:-**Here Is Formula To Find Area of Circle, Rectangle And Triangle now you can easily get a solution. Just take n input and put the values in given formula and your answer is on the screen according to your input. If you are having problem in switch Case then First see this problem this will help you to understand better way of switch cases.

**See This**C Program For Remove All Vowels From A String Using Switch Case

**Formula's**

1.

**Area of Circle**=====> 3.14*r*r (r=Radius)

2.

**Area of Rectangle**==> a*b

3.

**Area of Triangle**===> sqrt(s*(s-a)*(s-b)*(s-c));

Where S=(a+b+c)/2;

**Also Check:-**Geeksforgeeks solution for School, Basic, Easy, Medium, Hard in C++.

**Extreme Recommended:-**Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date for a new post or if you have any Query you can ask there with lots of coders also suggest to your Friends to join and like our page, so we can help our community, and don't forget to Subscribe. Enter your Email and click to subscribe.

**Solution:-**

#include<iostream>

#include<math.h>

using namespace std;

int main()

{

/*Visit - www.programmingwithbasics.com*/

float a,b,c,s,r,area;

int ch;

cout<<"1.Area Of Circle";

cout<<"\n2.Area Of Rectangle";

cout<<"\n3.Area Of Triangle \n";

cout<<"\nEnter Your Choice :";

cin>>ch;

switch(ch)

{

case 1:

{

cout<<"\nEnter Radius Of The Circle: ";

cin>>r;

area=3.14*r*r;

break;

}

case 2:

{

cout<<"\nEnter Length And Breadth Of Rectangle:";

cin>>a>>b;

area=a*b;

break;

}

case 3:

{

cout<<"\nEnter Three Sides Of The Triangle:";

cin>>a>>b>>c;

s=(a+b+c)/2;

area=sqrt(s*(s-a)*(s-b)*(s-c));

break;

}

default: cout<<"\n Invalid Choice Try Again...!!!";

break;

}

cout<<"Area = "<<area<<endl;

return 0;

}

**Output:-**

**You May Also Like**

1. C++ Program To Find Area And Circumference Of Circle

2. C++ Program To Print Ascii Value Of Character

3. C++ Program To Find Area Of Triangle

4. C++ Program To Check Number Is Prime Or Not Using If/Else Statements

5. C++ Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol Using If/Else Statements

6. C++ Program To Find Quotient And Reminder Of Two Numbers Using If/Else Statements

7. C++ Program To Print The Fibonacci Series Up to Given Number Of Terms

8. C++ Program to Sort Elements in Lexicographical Order (Dictionary Order) Using For Loop

9. C++ Program To Find The GCD And LCM Of Two Numbers

## 0 Comments: