C++ Program to calculate circumference of a circle [DEVCPP/GCC]


//Program to calculate circumference of a circle


#include <iostream>
#define pi 3.14
/* pi is a macro with value 3.14 i.e. The compiler replaces all the occurrences of pi with 3.14 */

using namespace std;

int main()
{
float r,area;

cout<<"ENTER RADIUS: ";
cin>>r;

area= 2*pi*r;

cout<<"CIRCUMFERENCE OF CIRCLE WITH RADIUS "<<r<<" IS "<<area;
return 0;
}



Share this

Related Posts

FIND US ON FACEBOOK!