C++ Program to Calculate Area of Circle using Function

By | 25.12.2016

Calculate Area of Circle using Function

Write a C++ Program to Calculate Area of Circle using Function. Here’s simple C++ Program to Calculate Area of Circle using Function in C++ Programming Language.

Numbers in C++

Normally, when we work with Numbers, we use primitive data types such as int, short, long, float and double, etc. The number data types, their possible values and number ranges have been explained while discussing C++ Data Types.

Here is source code of the C++ Program to Calculate Area of Circle using Function. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


/*  C++ Program to Calculate Area of Circle using Function  */

#include <iostream>
#define PI 3.14159
using namespace std;

float AreaOfCircle(float radius);
float AreaWithDiameter(float diameter);

int main()
    float radius,diameter,circleArea;
    char choice='0';
    cout<<"\n\t\t\tFind Area Of Circle:"<<endl;

         cout<<"\n1 to Enter Radius \n";
         cout<<"2 to Enter Diameter ";
         cout<<"\n\nEnter your Choice :: ";
         cout<<"\nEnter a VALID Option ";


    cout <<"\nEnter Radius To Find Area: ";
    else if(choice=='2')
    cout <<"\nEnter Diameter To Find Area: ";

    cout<<"\nArea of Circle is:->> "<<circleArea<<endl;
    return 0;

float AreaOfCircle(float radius)
    return (PI*(radius*radius));


float AreaWithDiameter(float diameter)

    return (AreaOfCircle(diameter/2));


/*  C++ Program to Calculate Area of Circle using Function  */

                       Find Area Of Circle:

1 to Enter Radius
2 to Enter Diameter

Enter your Choice :: 1

Enter Radius To Find Area: 4

Area of Circle is:->> 50.2654

Process returned 0

Above is the source code for C++ Program to Calculate Area of Circle using Function which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.

Thanks for reading the post….

4 2 votes
Article Rating
Category: C++ Programming Number Programs Tags:

About Tunde A

My name is Tunde Ajetomobi, a Tech Enthusiast and Growth Hacker. I enjoy creating helpful content that solves problem across different topics. Codezclub is my way of helping young aspiring programmers and students to hone their skills and find solutions on fundamental programming languages.

Notify of

Newest Most Voted
Inline Feedbacks
View all comments
bright israel

kindly assist with this question
write a program to compute the area and circumference of a circle also analyse the program

Dangare Akash Mahesh

The area of circle is ( PI*r*r )and circumference is ( 2*PI*r ).
You can create a function which will return area and another function with return value 2*PI*r. That’s all !

Ahmed Ali

Please can I have more programming question with answer

Jada Williams