summaryrefslogtreecommitdiff
path: root/662/CH4/EX4.28/ex4_28.sce
blob: e09c1811dbb44876427a10fddd03690c0e23fbf8 (plain)
1
2
3
4
5
6
7
8
9
10
            //Example 4.28
//use of flags with unsigned decimal, octal and hexadecimal numbers

i = 1234;
j = oct2dec('1777');
k = hex2dec('a08c');
printf(":%8u %8o %8x:\n\n", i, j, k);
printf(":%-8u %-8o %-8x:\n\n", i, j, k);
printf(":%#8u %#8o %#8X:\n\n", i, j, k);
printf(":%08u %08o %08X:\n\n", i, j, k);