default ivalue width, 4 : printf « stdio.h « C / ANSI-C






default ivalue width, 4

  
#include <stdio.h>

int main( )
{
 int    ivalue   =   1234;
 
 printf("%d",ivalue); 
}
  
    
  








Related examples in the same category

1.printf: display message by format
2.Output char
3.print the ASCII code for c
4.print character with ASCII 90
5.print ivalue as octal value
6.print lower-case hexadecimal
7.print upper-case hexadecimal
8.minimum width 1
9.minimum width 5, right-justify
10.minimum width 5, left-justify
11.33 non-null, automatically
12.31 non-null, automatically
13.minimum 5 overridden, auto 33
14.minimum width 38, right-justify
15.minimum width 38, left-justify
16.printf ivalue with + sign
17.minimum 3 overridden, auto 4
18.minimum width 10, right-justify
19.minimum width 10, left-justify
20.right justify with leading 0's
21.using default number of digits
22.minimum width 20, right-justify
23.right-justify with leading 0's
24.minimum width 20, left-justify
25.minimum width 19, print all 17
26.prints first 2 chars
27.prints 2 chars, right-justify
28.prints 2 chars, left-justify
29.using printf arguments
30.width 10, 8 to right of '.'
31.width 20, 2 to right-justify
32.4 decimal places, left-justify
33.decimal places, right-justify
34.width 20, scientific notation
35.printf %s for string
36.printf %d for integer
37.printf %ld for long integer number
38.printf %10d, %10.f