/* Program for finding Radius, Circumference and Area of a CIRCLE after getting Radius from user as input. */ #include <iostream> #include <cmath> #define PI 3.14159 using namespace std; int main() { int radius; float diameter, area, circumference; cout << "Enter Radius of circle (Integer)?\t"; cin >> radius; diameter = radius / 2.0; circumference = 2 * PI *radius; area = PI *pow(radius, 2); cout << "Diameter of the circle = \t" << diameter << endl; cout << "Circumference of the circle = \t" << circumference << endl; cout << "Area of the circle = \t" << area << endl; return 0; }
This blog is about coding in some commonly used "High Level Languages" like C, C++, Java etc. At first, I will post here basic programs written in C++ language only.
Tuesday, November 25, 2014
C++ Program for finding Radius, Circumference and Area of a CIRCLE
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment