#include<stdio.h>
int main(void)
{
double height,radius,volume;
double cylinder(double r,double h);
printf("Enter radius and height:");
scanf("%lf%lf",&radius,&height);
volume=cylinder(radius,height);
printf("Volume=%.3f\n",volume);
return 0;
}
double cylinder(double r,double h)
{
double result;
result=3.141 592 6*r*r*h;
return result;
}![](//images0.cnblogs.com/blog/570996/201310/06135427-148cef7e21ce44f28038579cd19efc60.jpg)
int main(void)
{
double height,radius,volume;
double cylinder(double r,double h);
printf("Enter radius and height:");
scanf("%lf%lf",&radius,&height);
volume=cylinder(radius,height);
printf("Volume=%.3f\n",volume);
return 0;
}
double cylinder(double r,double h)
{
double result;
result=3.141 592 6*r*r*h;
return result;
}
![](http://images0.cnblogs.com/blog/570996/201310/06135427-148cef7e21ce44f28038579cd19efc60.jpg)