Yurttas/PL/IL/C/F-mar11/04/01/io 00.c

Revision as of 23:15, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="c" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Permis...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : January 1, 1998.
11   author : Salih Yurttas.
12
13   io_00.c
14*/
15
16
17int main(int argc, char *argv[]) {
18
19  int i0 = 0,
20      i1 = 15,
21      i2 = 255;
22
23  printf("free formatted with space -\n");
24  printf("%d %d %d\n", i0, i1, i2);
25  printf("\n");
26
27  printf("formatted right-justifed -\n");
28  printf("%4d%4d%4d\n", i0, i1, i2);
29  printf("\n");
30
31  printf("formatted left-justifed -\n");
32  printf("%-4d%-4d%-4d\n", i0, i1, i2);
33  printf("\n");
34
35  printf("free formatted with tab -\n");
36  printf("%d\t%d\t%d\n", i0, i1, i2);
37  printf("\n");
38
39  printf("formatted with embedded text -\n");
40  printf("i0 = %4d, i1 = %4d, i2 = %4d\n", i0, i1, i2);
41  printf("\n");
42
43  printf("formatted with embedded text -\n");
44  printf("i0 = %4d\n", i0);
45  printf("i1 = %4d\n", i1);
46  printf("i2 = %4d\n", i2);
47  printf("\n");
48
49  printf("octal representations -\n");
50  printf("i0 = %4o, i1 = %4o, i2 = %4o\n", i0, i1, i2);
51  printf("\n");
52
53  printf("hexadecimal representations -\n");
54  printf("i0 = %4x, i1 = %4x, i2 = %4x\n", i0, i1, i2);
55  printf("\n");
56
57}