Answer to Question #233563 in C++ for Simon

Question #233563

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


1
Expert's answer
2021-09-06T00:17:06-0400
#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;
}

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