/* Program 4-5

   Integer and Floating Point Conversions */

main ()
 {
  int i1, i2 = -150;
  float f1 = 123.125, f2;
  char c = 'a';

  i1 = f1;                     /* float to int conversion */
  printf ("%f assigned to an int  produces  %d\n", f1, i1);

  f1 = i2;                     /* int to float conversion */
  printf ("%10d assigned to a float produces %f\n", i2, f1);

  f1 = i2 / 100;               /* int divided by int      */
  printf ("%10d divided  by  100    produces %f\n", i2, f1);

  f2 = i2 / 100.0;             /* int divided by float    */
  printf ("%10d divided  by  100.00 produces %f\n", i2, f2);
 }


/* Program Output

123.125000 assigned to an int  produces 123
      -150 assigned to a float produces -150.000000
      -150 divided  by  100    produces -1.000000
      -150 divided  by  100.0  produces -1.500000

*/
 