#include
# define PI 3.14
Int main ()
{
Int r, h, l;
Float S, V;
R=5;
H=12;
L=13;
S=l + PI PI * r * * r * r;
V=PI * r * r * h * (1/3);
Printf (" surface area S=% f=% f \ n \ n volume V ", S, V);
system("pause");
For bosses to see where I went wrong, why volume is zero,
CodePudding user response:
Code is no problem, or you r, h.l try with floating pointCodePudding user response:
V=PI * r * r * h * (1/3); This error, change as follows:# include
#include
# define PI 3.14
Int main (int arg c, char * argv [])
{
Int r, h, l;
Float S, V;
R=5;
H=12;
L=13;
S=l + PI PI * r * * r * r;
V=PI * r * r * h/3;//this modified
Printf (" surface area S=% f=% f \ n \ n volume V ", S, V);
system("pause");
return 0;