I made this program my self , it works but when it shows the result ιτ repeats ""Can't accept negative numbers or 0 " even if the numbers are correct . What's the problem ?
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float r , p , s;
float P=3.14;
do
{
cout<<"r=";
cin>>r;
if (r<=0);
cout<<"Can't accept negative numbers or 0 "<<endl;
}
while (r<=0);
p=2*P*r;
s=P*pow(r,2);
cout<<"The perimeter is : " <<p<<endl;
cout<<"The area is : " <<s<<endl;