The Area of a Circle = pi *(r*r). Where pi=3.1415 and r=Radius, Make a program that will
input Radius and compute and display the Area. Your program will be terminated if input zero
in the radius.
#include<iostream>
using namespace std;
int main(){
double pi=3.1415, r;
do{
cout<<"Enter radius:\n";
cin>>r;
double area = pi *(r*r);
cout<<"The radius is: "<<r<<"\nThe area is: "<<area<<endl;
} while(r !=0);
cout<"The program terminated successfully";
}
Comments
Leave a comment