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
Inheritance and Reuse Consider a car manufacturing company. When they require building a new car, they have two choices. They can start from the scratch, or they can change an

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

#include long BixFunction(int x, int y = 5, float z = 5) { return(++x * ++y + (int)++z); } int main() { cout return 0; }

Mixed Mode Expressions and Implicit type Conversions A mixed mode expression is one in which the operands are not of the similar type. In this case, the operands are converted

Question 1 Implement a class stack which simulates the operations of the stack allowing LIFO operations. Also implement push and pop operations for the stack 2 Explain the c

A: Provide a friend operator class Base { public: friend std::ostream& operator ... protected: virtual void printOn(std::ostream& o) const; }; inline std::ostr

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Array of Objects: The objects can be declared just like a structure or even a primary data type.  Array of objects may be required to work with large set of data.   When the da

The default Constructor and Destructor If you fail to write a constructor and destructor function,  the compiler automatically supplies them for you. These functions have publi