Question #233563

Write an algorithm for a program that prompts the user to enter the radius of a circle, and then calculate its perimeter


Expert's answer

#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
using namespace std;


int main()
{
	double rad;//Radius
	cout << "Please input Radius of a Circle:";
	cin >> rad;
	double per = rad * 2 * M_PI;
	cout << "Perimetr: " << per << endl;
	return 0;
}
LATEST TUTORIALS
APPROVED BY CLIENTS