76 296
Assignments Done
Successfully Done
In May 2019

Answer to Question #16014 in C++ for anika

Question #16014
write a c++ program to input choice (1 or 2 ) if choice is 1 print the area of a circle otherwise print the perimeter of a circle .accept the radius of a circle from user
Expert's answer
using namespace std;

float r;
int a;

void main(){
cout<<"enter the radius of a circle: ";
cout<<"press 1 for area of a circle or 2 for perimeter of a circle: ";
if (a==1) cout<<"Area of a circle is "<<3.14*r*r<<"\n";
else cout<<"Perimeter of a circle is "<<2*3.14*r<<"\n";

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions