How do you write a C++ computer program computing that computes the volume of a...

  • Thread starter Thread starter KRC
  • Start date Start date
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.
 
Back
Top