Saturday, 23 June 2012

how to determine volume of the cylinder using c++



This is the source code to determine volume of the cylinder 
#include<iostream.h>
#include<conio.h>
main()
{
      float r,h,volume;
      const float pi=3.1417;
      cout<<"enter the value of radius of the cylinder:";
      cin>>r;
       cout<<"enter the value of hieght of the cylinder:";
       cin>>h;
       volume=pi*r*r*h;
       cout<<"volume of the cylinder is="<<volume;
       getch();
       }
End

1 comment: