1
0

pizza.c 447 B

12345678910111213141516
  1. /* pizza.c -- uses defined constants in a pizza context */
  2. #include <stdio.h>
  3. #define PI 3.14159
  4. int main(void)
  5. {
  6. float area, circum, radius;
  7. printf("What is the radius of your pizza?\n");
  8. scanf("%f", &radius);
  9. area = PI * radius * radius;
  10. circum = 2.0 * PI *radius;
  11. printf("Your basic pizza parameters are as follows:\n");
  12. printf("circumference = %1.2f, area = %1.2f\n", circum,
  13. area);
  14. return 0;
  15. }