C++ To Calculate Area Of Circle, Rectangle And Triangle Using Switch Case

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


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.



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 :";


case 1:
cout<<"\nEnter Radius Of The Circle: ";
case 2:
cout<<"\nEnter Length And Breadth Of Rectangle:";
case 3:
cout<<"\nEnter Three Sides Of The Triangle:";
default: cout<<"\n Invalid Choice Try Again...!!!";

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

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me