inzhagi
asked on
Programs that read in the radius of a circle and prints the circle diameter....
Hai there...i need to write a program that reads in the radius of a circle and prints the circle diameter,circumference and area. The constant value is 3.14159 for pie. For example if the user enter 5, then it will shows the result of
Diameter=10
Circumference=31.4159
Area=78.5397
Formula for the circumference and area of circle are C= 2 pie radius and A=pie radius^2
Diameter=10
Circumference=31.4159
Area=78.5397
Formula for the circumference and area of circle are C= 2 pie radius and A=pie radius^2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what kind of error ??
i ran the code and it give me the expected result !!!
i ran the code and it give me the expected result !!!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Venabili ..
I tried to help him to accomplish his homework , and I think the asker respond to my comment and gave a full code for the solution .(I guess he followed the steps I provided in my first comment to write the code),BUT I think he solved the error after posting his code -THAT WHY HE DID NOT POST THE ERROR-.
regards, Ahmad;
I tried to help him to accomplish his homework , and I think the asker respond to my comment and gave a full code for the solution .(I guess he followed the steps I provided in my first comment to write the code),BUT I think he solved the error after posting his code -THAT WHY HE DID NOT POST THE ERROR-.
regards, Ahmad;
Well, Venabili ..
are you going to refund or accept an answer??
are you going to refund or accept an answer??
ASKER
main()
{
const double pie = 3.14159;
double r;
double D;
double C;
double A;
cout <<"Enter the radius"<< endl;
cin >> r ;
D = 2*r;
C = 2*pie*r;
A = pie*r*r;
cout <<"Diameter:"<<D<<"D"<<end
cout <<"Circumference:"<<C<<"C"
cout <<"Area:"<<A<<"A"<<endl;
return 0;
}
i get an error