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

  1. /* hardware.c -- shows a mixture of int, */
  2. /*               float, and char types   */
  3.  
  4. main()
  5. {
  6.     int threads    = 8;       /* threads per inch */
  7.     float length   = 1.25,    /* length in inches */
  8.           diameter = 0.425,   /* diameter in inches */
  9.           price    = 0.89;    /* price per hundred */
  10.     char bin = 'A';           /* kept in bin A */
  11.     long quantity = 42300;    /* number in bin */
  12.  
  13.     printf("Screws: %d threads/inch\n%f inches long\n",
  14.             threads, length);
  15.     printf("%f diameter\n\n", diameter);
  16.     printf("Price per 100: %f\n", price);
  17.     printf("Stored in bin: %c\nQuantity on hand: %ld",
  18.             bin, quantity);
  19. }
  20.