This program runs, but all of the values are coming out as 0.0.
Write a program that ask the user for the radius of a circle as a float value and prints a table with the circle’s diameter, its circumference and its area. Use a const float to represent a value for PI that is equal to 3.14159.
Code:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
float pi=3.14, area=0, circumference=0, diameter=0, radius=0, m=0;
printf("Enter the raidus of a circle:\n");
scanf("%f", &radius);
radius = m;
do
{
area=pi*m*m;
circumference=2*(pi*m);
diameter=2*m;
}
while (m!=0);
printf("%f is the Area \n",area);
printf("%f is the Circumference \n",circumference);
printf("%f is the Diameter \n",diameter);
system("pause");
return 0;