// File name: circle.cpp // Author: Xiannong Meng // Course: CS2330 // Date: January 15, 1997 // Assignment: classroom demonstration // Problem statement: This program calcualtes radius and circumference // of a circle for a given area value, using math. functions. #include #include void main(void) { // constants const float PI = 3.14159; // variables float area; // input: area of circle float radius; // output: radius of circle float circum; // output: circumference of circle // read input cout << "Enter the area of the circle : "; cin >> area; // calcualte circle radius, using math function 'sqrt' radius = sqrt( area / PI ); // calcualte circle circumference circum = 2 * PI * radius; // display the result cout << "The radius of the circle is " << radius << endl; cout << "The circumference of the circle is " << circum << endl; }