k, i can't find the bug to this program
Code:#include <stdio.h> int main(void) { /* Variable Declarations */ #define Pi 3.14159265 int sph_r, cb_s, crcl_r, sqr_s; int sph_sa, sph_v, cb_sa, cb_v, crcl_a, sqr_a; /* Sphere */ printf("Enter the radius of a sphere: "); scanf("%f", & sph_r); sph_sa = 4 * Pi * sph_r * sph_r; sph_v = 4/3 * Pi * sph_r * sph_r * sph_r; printf("%f %f \n", sph_sa, sph_v); /* Cube */ printf("Enter the length of a side of a cube: "); scanf("%f", &cb_s); cb_sa = 6 * cb_s * cb_s; cb_v = cb_s * cb_s * cb_s; printf("%f %f \n", cb_sa, cb_v); /* Circle */ printf("Enter the radius of a circle: "); scanf("%f", &crcl_r); crcl_a = Pi * crcl_r * crcl_r; printf("%f %f \n", crcl_a); /* Square */ printf("Enter the length of a side of a square: "); scanf("%f", &sqr_s); sqr_a = sqr_s^2; printf("%f %f \n ", sqr_a); }



LinkBack URL
About LinkBacks


