Hello, also my first post here..
I feel a bit ashamed to ask it here, but I can't find answers elsewhere..
So sorry for asking such an easy thing, as it may be for the most of you..
But I am really pretty new to all of this, but motivated and enthusiastic about getting along.
I was trying to write a program to calculate the Volume of a sphere.
What I do not understand is, why my results when executed appear to be approximate results instead of exactly calculated.
Code:
#include <stdio.h>
int main()
{
float v, r, pi;
pi=3,14;
printf("Type in the sphere's radius: ");
scanf("%f", &r);
v = (4.0 * pi * r * r * r / 3.0);
printf("The volume of a sphere is %.2f\n", v);
return 0;
}