Area Of Circle Example C++ Program


Definition

The area of a circle is π (Pi) times the Radius squared, which is written A=πr2.

Formula

The area of a circle is written

A=πr2

here,

r = Radius
π = ~3.14

Area Of Circle Example Program

/*##Area Of Circle In C++*/
/*##Calculation C++ Programs, Datatype C++ Programs, Basic C++ Programs*/

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

using namespace std;

int main(){
	// Declare Variables
	float radius, area;

	cout << "Simple C++ Program : Area Of Circle\n";
	cout <<"\nEnter the radius of Circle : ";
	cin>>radius;

	area = 3.14 * radius * radius;
	cout <<"\nArea of Circle : "<<area;

	getch();
	return (0);
}

Sample Output

Simple C++ Program : Area Of Circle

Enter the radius of Circle: 2.0
Area of Circle:12.57