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
1
Expert's answer
2012-10-10T11:14:13-0400
#include<iostream> using namespace std;
float r; int a;
void main(){ cout<<"enter the radius of a circle: "; cin>>r; cout<<"press 1 for area of a circle or 2 for perimeter of a circle: "; cin>>a; 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"; system("PAUSE"); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment