/*
  Program to calculate circumference, area, and volume
  given a radius.
*/

#include <stdio.h>

main()
{
  /*  Declaration Statements  */
  double pi, circum, area, vol, r;
  short n;

  /*  Assignment Statements  */
  clrscr();
  printf("C48.C -> Program to calculate circumference, area and volume\n");
  printf("given a radius.\n");
  printf("\n");                         /*  This program will compute  */
  pi = 3.14159;                         /*  circ.,area and volume with */
  printf("Enter the radii : ");         /*  all radius from 1 to n by  */
  scanf("%hd", &n);                     /*  step of 0.5                */
  getchar();
  printf("\n%6crad%6ccir%5carea%6cvol\n", ' ', ' ', ' ', ' ');

  r = 1.0;
  while (r <= n) {
    circum = 2.0 * pi * r;
    area = pi * r * r;
    vol = 4.0 / 3.0 * pi * r * r * r;

    /*  Print results  */
    printf("%9.2f%9.2f%9.2f%9.2f\n", r, circum, area, vol);
    r += 0.5;
  }  /*  End of while{} loop  */
  printf("\n");

  return(0);
}
/*  End of Program C48  */