- Nov 19, 2004
- 2,654
- 0
- 71
#include <stdio.h>
#define PI 3.14151
main() {
double radius,diameter,circumference,area,volume;
printf("Find nice uses of raii \n\n");
printf(" Radius Diameter Circumference\n");
printf(" --------- --------- -------------\n");
for (radius = 1; radius <= 20; radius += 1)
printf("%12.1lf%17.1lf\n", radius, radius*2);
for (diameter = 1; radius <= 20; radius += 1)
printf("%12.1lf%17.1lf\n", radius, radius*2);
system("pause");
return 0;
}
I create a table that can take a radii from 1 to 20 and tell me the diameter, circumference, area and volume.
I was able to find an example that let me move from radius to diameterm, but it doesnt work with that 12.1lf, 1731lf and i have no clue why not. Also, i cant figure out how to move past that stage and into finding circumference! can someone tell me what to do? I want to use the same radius to make diameter(done) , circumference(HELP), area(HELP) and volume(HELP)
(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)
#define PI 3.14151
main() {
double radius,diameter,circumference,area,volume;
printf("Find nice uses of raii \n\n");
printf(" Radius Diameter Circumference\n");
printf(" --------- --------- -------------\n");
for (radius = 1; radius <= 20; radius += 1)
printf("%12.1lf%17.1lf\n", radius, radius*2);
for (diameter = 1; radius <= 20; radius += 1)
printf("%12.1lf%17.1lf\n", radius, radius*2);
system("pause");
return 0;
}
I create a table that can take a radii from 1 to 20 and tell me the diameter, circumference, area and volume.
I was able to find an example that let me move from radius to diameterm, but it doesnt work with that 12.1lf, 1731lf and i have no clue why not. Also, i cant figure out how to move past that stage and into finding circumference! can someone tell me what to do? I want to use the same radius to make diameter(done) , circumference(HELP), area(HELP) and volume(HELP)
(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)(HELP)