Non-decimal radices/Output: Difference between revisions

Content added Content deleted
m (Link to Octal)
(Ada solution added)
Line 4:
 
 
=={{header|Ada}}==
<lang ada>
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
 
procedure Test_Integer_Text_IO is
begin
for I in 1..33 loop
Put (I, Width =>3, Base=> 10);
Put (I, Width =>7, Base=> 16);
Put (I, Width =>6, Base=> 8);
New_Line;
end loop;
end Test_Integer_Text_IO;
</lang>
Sample output:
<pre style="height:30ex;overflow:scroll">
1 16#1# 8#1#
2 16#2# 8#2#
3 16#3# 8#3#
4 16#4# 8#4#
5 16#5# 8#5#
6 16#6# 8#6#
7 16#7# 8#7#
8 16#8# 8#10#
9 16#9# 8#11#
10 16#A# 8#12#
11 16#B# 8#13#
12 16#C# 8#14#
13 16#D# 8#15#
14 16#E# 8#16#
15 16#F# 8#17#
16 16#10# 8#20#
17 16#11# 8#21#
18 16#12# 8#22#
19 16#13# 8#23#
20 16#14# 8#24#
21 16#15# 8#25#
22 16#16# 8#26#
23 16#17# 8#27#
24 16#18# 8#30#
25 16#19# 8#31#
26 16#1A# 8#32#
27 16#1B# 8#33#
28 16#1C# 8#34#
29 16#1D# 8#35#
30 16#1E# 8#36#
31 16#1F# 8#37#
32 16#20# 8#40#
33 16#21# 8#41#
</pre>
=={{header|C}}==