C++ program to find the area of the circle

In this article, we will learn a C++ program to find the area of the circle. This program takes a radius from the user and shows the area of the circle on the console screen.

Formula

We can calculate the area of the circle by using the formula A = π r2

area of circle in cpp

where π value is 3.14159

Example: Area of the circle in C++

#include <iostream>
 using namespace std;
int main()
{
    float area, radius;
 
    cout << "Enter the radius of a circle : ";
    cin >> radius;
    area = 3.14 * radius * radius;
    cout << "Area of circle will be: "<< area;
    return 0;
}

Output

cpp program to find area of the circle

Recommended Articles

C++ program to print star patterns

C++ student grade program

C++ program to find factorial

Scroll to Top