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

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Conversion between Objects of Different Classes As the compiler does not know anything about the user-defined type, the conversion instructions are to be specified in a functio

find area uder the curve y=f(x) between x=a and x=b   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; in

develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele


wap to count the numof string present in a word


#question. write a program number to alphabet in c++..