Posted by: alece September 23, 2014
Login in to Rate this Post:
0
?
#include
using namespace std;
int main(){
const float PI = 3.1459;
float r;
double diameter, perimeter, area;
cout << "This progaram calculates diameter, perimeter and area of circle" << endl;
cout << "Please enter the radius of circle";
cin >> r;
diameter = 2 * r;
perimeter = r*(2 + PI);
area = pow(r, 2)* PI / 2;
cout << "The diameter of circle is: " << diameter << endl;
cout << "The perimeter of circle is: " << perimeter << endl;
cout << "The area of the circle is: " << area << endl;
system("pause");
}
using namespace std;
int main(){
const float PI = 3.1459;
float r;
double diameter, perimeter, area;
cout << "This progaram calculates diameter, perimeter and area of circle" << endl;
cout << "Please enter the radius of circle";
cin >> r;
diameter = 2 * r;
perimeter = r*(2 + PI);
area = pow(r, 2)* PI / 2;
cout << "The diameter of circle is: " << diameter << endl;
cout << "The perimeter of circle is: " << perimeter << endl;
cout << "The area of the circle is: " << area << endl;
system("pause");
}