Sunday, 16 October 2016

HHW Q19. WAP to calculate TSA and volume of a Cone .

#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
float r,l,h,tsa,csa,v;
cout<<"Enter radius of the Cone ";
cin>>r;
cout<<"Enter height of the Cone ";
cin>>h;
cout<<"Enter slant height of the cone ";
cin>>l;
float const pi=3.14;
v=(0.33)*pi*r*r*h;
csa=pi*r*l;
tsa=(pi*r*l)+(pi*r*r);
cout<<"Volume of Cone = "<<v<<"\n";
cout<<"CSA of Cone = "<<csa<<"\n";
cout<<"TSA of Cone = "<<tsa<<"\n";
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...