Write an algorithm for a program that prompts the user to enter the radius of a circle, and then calculate its area
#include <iostream>
using namespace std;
int main(){
float PI = 3.147;
float radius = 0;
cout<<"Enter the radius of a circle: ";
cin>>radius;
float area=PI*radius*radius;
cout<<"Area = "<<area<<"\n";
system("pause");
return 0;
}
Comments
Leave a comment