home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO7.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  384 b   |  19 lines

  1. /* INTRO7.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.    float result;
  8.    result = 1.0 + 2.0 * 3.0 / 4.0;
  9.    printf("%f\n", result);
  10.    result = 1.0 / 2.0 + 3.0;
  11.    printf("%f\n", result);
  12.    result = (1.0 + 2.0) / 3.0;
  13.    printf("%f\n", result);
  14.    result = (1.0 + 2.0 / 3.0) + 4.0;
  15.    printf("%f\n", result);
  16.  
  17.    return 0;
  18. }
  19.