You are on page 1of 2

WAP to input radius of the circle according to

the choice of user if user enters 1 print area


otherwise circumference
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float n,r,out;
cout<<"\nenter radius of the circle";
cin>>n;
cout<<"\nenter 1 for area and 2 for perimeter";
cin>>r;
out=(r==1)?(3.14*n*n):(2*3.14*n);
cout<<"\nyour output is"<<out;
getch();
}
If user enter 1

If user enter 2

You might also like