/*
  Demonstration of a simple while{} loop.
*/

#include <stdio.h>

main()
{
  /*  Declaration Statements  */

  double sum, count, ave;

  /*  Assignment Statements  */

  printf("C32.C -> Program to demonstrate simple while{} loop.\n");
  printf("\nEnter Sum :");
  scanf("%lg", &sum);
  printf("\nEnter Count ( 0 to stop the program ) :");
  scanf("%lg",&count);
  getchar();
  while (count != 0.0) {
    ave = sum / count;
    printf("sum =% .5E\n", sum);
    printf("count =% .5E\n", count);
    printf("average =% .5E\n", ave);
    printf("==========================\n\n");
    printf("Enter Sum :");
    scanf("%lg", &sum);
    printf("Enter Count ( 0 to stop the program ) :");
    scanf("%lg",&count);
    getchar();
    clrscr();  /*  To clear screen before new entry  */
  }

  return(0);
}
/*  End of Program C32  */