home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / learn / nformat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  489 b   |  24 lines

  1. /* NFORMAT.C: Prints numbers and a string. */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. main()
  7. {
  8.    int    a = -765,
  9.           b = 1,
  10.           c = 44000,
  11.           d = 33;
  12.    float  e = 1.33E8,
  13.           f = -0.1234567,
  14.           g = 12345.6789,
  15.           h = 1.0;
  16.    char   i[80];
  17.  
  18.    strcpy( i, "word 1, word 2, word 3, word 4, word 5" );
  19.  
  20.    printf( "Unformatted:\n%d %d %d %d\n", a, b, c, d );
  21.    printf( "%f %f %f %f\n", e, f, g, h );
  22.    printf( "%s\n", i );
  23. }
  24.