Create a program that will show the use of the pontoon when calculating Suprina
rezes (S = r * r * pi) rezes which take values from 10 to 100, but whose values are divisible by
number x.
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "Enter x value: ";
cin >> x;
int r;
const double PI = 3.145;
while (true)
{
cout << "Enter r (10 - 100): ";
cin >> r;
if (r % x != 0)
{
cout << "r are not divisible by x!" << endl;
continue;
}
if (r < 10 || r >100)
{
cout << "r is out of range 10-100!" << endl;
continue;
}
cout << "S = " << r * r * PI << endl;
break;
}
return 0;
}
Comments
Leave a comment