TheFestFever.com

Our aim is to connect students from campuses all over Delhi by making them aware of all Technical, Cultural, Management fests, workshops, Seminars organized by every college in Delhi.

Join Us Now

Program 8: Write a C++ program to find the area of circle, rectangle and triangle.

#include<iostream.h>
#include<conio.h>
#include<math.h>

int main()
{
	float a,b,c,x,p,q,n,s;
	cout<<"\nenter radius of the circle : ";
	cin>>n;
	x=((3.14*n)*n);

	cout<<"\narea of the circle is : "<<x;
	cout<<"\nenter length and breadth of the rectangle : ";
	cin>>p>>q;
	x=(p*q);

	cout<<"\narea of the rectangle is : "<<x;
	cout<<"\nenter three sides of the triangle : ";
	cin>>a>>b>>c;

	s=((a+b+c)/2);
	x=sqrt((s*(s-a))*((s-b)*(s-c)));

	cout<<"\narea of the triangle is : "<<x;
	getch();
	return 0;
}



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.