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

  1. /* tabs.c -- shows formatting with the \t */
  2. /*           tab escape sequence          */
  3.  
  4. main()
  5. {
  6.     int    q1 = 338, q2 = 57, q3 = 1048, q4 = 778,
  7.            /* quantity in bin */
  8.            t1 = 6, t2 = 8, t3 = 12, t4 = 16;
  9.            /* threads per inch */
  10.  
  11.     float  s1 = 0.250, s2 = 0.500, s3 = 0.750, s4 = 1.0;
  12.            /* size in inches */
  13.  
  14.     /* print table header */
  15.     printf("number\t\t size\t\t threads\n");
  16.     printf("in bin\t\t (inches)\t per inch\n\n");
  17.  
  18.     /* print lines of table */
  19.     printf("%d\t\t %f\t %d\n", q1, s1, t1);
  20.     printf("%d\t\t %f\t %d\n", q2, s2, t2);
  21.     printf("%d\t\t %f\t %d\n", q3, s3, t3);
  22.     printf("%d\t\t %f\t %d\n", q4, s4, t4);
  23. }
  24.