/*
  Demonstration of while loops and the formatting codes for printf
*/

#include <stdio.h>

main()
{
     /*  Declaration Statements  */
     short i, j;
     double ks, lt;
     printf("C42.C -> While loops and printf formatting codes.\n");

     /*  Initializing variables  */
     ks = 0.0;
     lt = 0.0;
     i = 1;

     /*  Assignment Statements  */
     while (i <= 10) {
          for (j = 1; j <= 10; j++)
               ks += j;
          lt += i;
          printf("i = %d, ks = % .5E, lt = % .5E\n", i, ks, lt);
          i += 2;
     }  /*  End of while{} loop  */

return(0);
}
/*  End of Program C42  */