i am a beginner in programming and i have a doubt:
what is wrong with the following code? the result is always 0...
Code:#include <stdio.h>
float pi;
float raio;
float volume;
char line[100];
int main() {
pi = 3.14159265;
printf("qual o raio da esfera? ");
fgets(line, sizeof(line), stdin);
sscanf(line, "%f", &raio);
volume = (3/4) * pi * (raio*raio*raio); /* 0.75 instead of 3/4 does the job... */
printf("volume e %f\n", volume);
return (0);
}