K
KRC
Guest
...cylinder? My program (which is in c, trying to compute the volume of a cylinder) keeps telling me i have a sigmentation error. This is my program. Any ideas?
#include <stdio.h>
# include <math.h>
main()
{
double r,h,p,v;
printf ("please enter the radius, height, and pi:\n");
scanf("%lf %lf %lf %r,%h,%pi");
v=r*r*h*pi;
printf("The volume is; %5.2f\n",v);
}
It asks me for to enter the radius, height, and pi, but then it says I have a sigmentation error.
#include <stdio.h>
# include <math.h>
main()
{
double r,h,p,v;
printf ("please enter the radius, height, and pi:\n");
scanf("%lf %lf %lf %r,%h,%pi");
v=r*r*h*pi;
printf("The volume is; %5.2f\n",v);
}
It asks me for to enter the radius, height, and pi, but then it says I have a sigmentation error.