//Wap to find area of circle untill the entered radius is zero by using while loop.
Coding:-
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,r,pi=3.14;
cout<<"enter the radius of circle";
cin>>r;
while(r!=0)
{
a=(pi)*r*r;
cout<<"the area is"<<a<<endl;
cout<<"enter the radius again";
cin>>r;
}
getch();
}
Output:-
Coding:-
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,r,pi=3.14;
cout<<"enter the radius of circle";
cin>>r;
while(r!=0)
{
a=(pi)*r*r;
cout<<"the area is"<<a<<endl;
cout<<"enter the radius again";
cin>>r;
}
getch();
}
Output:-
No comments:
Post a Comment