Here is source code of the C++ program which computes area of circle. The C++ program is successfully compiled and run on a Linux system. The program output is also shown below.
* C++ Program to Compute the Area of Circle
float radius, area;
std::cout << "Enter the radius of circle : ";
std::cin >> radius;
area = 3.14 * radius * radius;
std::cout << "Area of circle with radius "
<< radius << " is " << area;
$ g++ main.cpp $ ./a.out Enter the radius of circle : 5 Area of circle with radius 5 is 78.5
Sanfoundry Global Education & Learning Series – 1000 C++ Programs.
If you liked this C++ Program, kindly share, recommend or like below!