Tuesday, 25 August 2015

Write and run a program that performs the following steps: a. Assigning value to the radius r. b. Calculating the circumference using the formula: C = 2 X Pi X r. c. Displaying the circumference.

#include"stdafx.h"
#include<iostream>
usingnamespace std;
void main()
{
float radius=15;
float Pi=3.1416;
float c;
c=2*3.1416*radius;
cout<<"The circumference is "<<c<<endl;
     system ("pause");

}

No comments:

Post a Comment