Q:

Calculate the area and perimeter of a circle using c++

0

Write a program that calculates the area and perimeter of a circle

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;
int main(){
float rad;
const float pi=3.14159;
cout<<"enter the radius of the circle:";
cin>>rad;
float area=pi*rad*rad;
float per=2*pi*rad;
cout<<"area is:"<<area<<" ";
cout<<"perimeter is:"<<per;
}

 

Output:

enter the radius of the circle:15
area is:706.858 perimeter is:94.2477

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Find Factor of a number using c++... >>
<< Calculate the square root of a number using c++...