calculate the area of circle using c programconst


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;

}

 

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: calculate the area of circle using c programconst
Reference No:- TGS0174773

Expected delivery within 24 Hours