Answer to Question #186923 in C++ for Engin

Question #186923
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.
1
Expert's answer
2021-04-29T03:16:18-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS