diff options
Diffstat (limited to '662/CH4/EX4.28/ex4_28.sce')
-rwxr-xr-x | 662/CH4/EX4.28/ex4_28.sce | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/662/CH4/EX4.28/ex4_28.sce b/662/CH4/EX4.28/ex4_28.sce new file mode 100755 index 000000000..e09c1811d --- /dev/null +++ b/662/CH4/EX4.28/ex4_28.sce @@ -0,0 +1,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);
\ No newline at end of file |