Wednesday, 27 August 2014

Area of Torus (surface) solution in cpp

Leave a Comment


//Area of Torus (surface) pi2 × (radius22 - radius12)
#include<iostream>
#include<math.h>
using namespace std;
static double pi=3.1415926535;
int main()
{
double radius1,radius2,Ans;
cout<<"Enter Radius 1 = ";
cin>>radius1;
cout<<"Enter Radius 2 = ";
cin>>radius2;
Ans=pow(pi,2)*(pow(radius1,2)-pow(radius2,2));
cout<<"Area of Torus (surface) = "<<Ans<<endl;
system("pause");
}
If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: