Computer Science, asked by sagarbaliyan, 1 year ago

write a program to input a choice (1 or 2) if choice is 1 print the area f circle otherwise print the perimeter of circle in c++

Answers

Answered by mitali098
11
#include
#include
void main()
{
float r,pie=3.14f, result;
int choice;
clrscr();
cout<<"\t\t[1] Area of circle";
cout<<"\n\t\t[2] Perimeter of circle";
cout<<"Enter the choice";
cin>>choice;
cout<<"enter the radius of circle";
cin>>r;
result=(choice==1)?pie*r*r:2*pie*r;
cout<<"Result is"< getch();
}



Similar questions