Answer to Question #283160 in C++ for Komal

Question #283160

Take input for the radius of a circle then calculate its area, circumference and diameter,



hen output the three results.



(Area= nr²



circumference=2ftr



diameter=2r)

1
Expert's answer
2021-12-28T01:32:08-0500
#include <iostream>
using namespace std;
int main(){
    float radius;
    const int pi = 3.14159;


    cout<<"Input radius: ";
    cin>>radius;


    cout<<"Area: "<<pi * radius * radius;
    cout<<"\nCircumference: "<<2 * pi * radius;
    cout<<"\nDiameter: "<<2 * radius;


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog