Calculate the area of circle using c program, C/C++ Programming

Calculate the area of circle using c program:

const float Pi = 3.1415926;

 

inline float area(const float r) {return Pi * r * r;}

 

main()

{

   float radius;

 

   cout << "Enter the radius of a circle: ";

   cin >> radius;

   cout << "The area is " << area(radius) << "\n";

   return 0;

}

 

 

Posted Date: 10/18/2012 6:46:12 AM | Location : United States







Related Discussions:- Calculate the area of circle using c program, Assignment Help, Ask Question on Calculate the area of circle using c program, Get Answer, Expert's Help, Calculate the area of circle using c program Discussions

Write discussion on Calculate the area of circle using c program
Your posts are moderated
Related Questions
The program will ask the user to enter: '1' to List the cities(and their state abbrev)  from largest to smallest (by their population) with their population '2'  to List the

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

I. COURSE DESCRIPTION Develops a working knowledge of object-oriented concepts in areas of classes, inheritance, data structures, error handling, templates and file processing.

Should I call a destructor explicitly on a local variable?

it is a class enclosed in the scope of another class. For illustration: // Example: Nested class // class OuterClass { class NestedClass { // ... }; // .

question c

FIT 3042 System Tools and Programming Languages Semester 1 2013 Assignment 1 An SDL video player for a custom video format Worth: 20% of final mark. Must be completed individually

Requirements: 1.  This assignment as well as other assignments in this class must be finished on Windows operating system. 2.  Zip your program and submit the zip file on ANG

Debug the following program to calculate N! #include using namespace std; main() {             int N, factorial=1;             cout             cin >> N;

Rules of Operator Overloading It is a function defined to an operator with new term or meaning. It cannot produce new operator. It cannot modified the meaning of th