C++ program to find the volume of solid & hollow cylinder

C++ program to find the volume of solid & hollow cylinder




C++ C++ Check if string is a Palindrome or not Using Pointers

MENU DRIVEN PROGRAM TO FIND THE VOLUME OF SOLID AND HOLLOW CYLINDER WITH THE HELP OF FUNCTION OVERLOADING
#include<iostream.h>
void main()
{
float s,r,h;
cout<<”Enter the outer radius of the Cylinder is :”;
cin>>s;
cout<<”\nEnter theĀ innerĀ radius of the Cylinder is : “;
cin>>r;
cout<<”\nEnter the height of the Cylinder :”;
cin>>h;
void cylinder(float,float);
void cylinder(float,float,float);
cylinder(s,h);
cylinder(s,r,h);
}
void cylinder(float s,float h)
{
float v;
v=3.14*s*s*h;
cout<<”\nThe volume of solid cylinder is :”;
cout<<v;
}

void cylinder(float s,float r,float h)
{
float v;
v=3.14*(s-r)*(s-r)*h;
cout<<”\nThe volume of hollow cylinder is :”;
cout<<v;
}


Rate this post




Further Reading:
http://en.wikipedia.org/wiki/Program
http://en.wikipedia.org/wiki/Find
http://en.wikipedia.org/wiki/Volume
http://en.wikipedia.org/wiki/Solid
http://en.wikipedia.org/wiki/Hollow

You read About:C++ program to find the volume of solid & hollow cylinder

Posted by: Prateek on October 6, 2011


Previous Post: « Next Post: »

© 2017 Trendfy. All rights reserved
Blog Managed by Prateek Jaiswal