Area and circumference using function - C++ program

Q. Write a C++ program to calculate area and circumference of circle using function.

Answer:

Following program is calculating area and circumference of a circle using function.

#include<iostream>
using namespace std;
float area(float);
float circum(float);
int main()
{
        int radius;   
        cout<<"\n Enter Radius of Circle: ";
        cin>>radius;
        cout<<"\n Area of Circle : "<<area(radius);
        cout<<"\n Circumference of Circle : "<<circum(radius);
}
float area(float radius)
{
        return (3.14 * radius * radius);
}
float circum(float radius)
{
        return(2 * 3.14 * radius);
}


Output:

area circumference circle