Categories

An if elese example

#include
#include

int main()
{
double radius;
//get user input
cout<<"Please enter the radius : ";
cin>>radius;
//act on user input
if(radius < 0.0)
cout<<"Cannot have a negative radius"< else
cout<<"The area of the circle is "<<3.1416 * pow(radius,2)<

return 0;
}

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

You must be logged in to post a comment.