home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap03 / score.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-06  |  624 b   |  20 lines

  1. /* score.c -- defines and prints   */
  2. /*            int and long vars    */
  3.  
  4. main()
  5. {
  6.     /* declare some int variables and assign values */
  7.     /* to them in the same statement                */
  8.  
  9.     int home = 5, visitors = 2, inning =7, attendance = 31300;
  10.     long total_attendance = 1135477;  /* long int */
  11.  
  12.     /* print out the values */
  13.  
  14.     printf("The score after %d innings is \n", inning);
  15.     printf("Home team %d, Visitors %d.\n\n", home, visitors);
  16.     printf("The attendance today is %d.\n", attendance);
  17.     printf("Attendance this year to date is %ld.",
  18.             total_attendance);
  19. }
  20.