Count in octal: Difference between revisions
Content added Content deleted
(Added Ada code) |
m (Added Ada code) |
||
Line 10: | Line 10: | ||
package IIO is new Ada.Text_IO.Integer_IO(Integer); |
package IIO is new Ada.Text_IO.Integer_IO(Integer); |
||
begin |
begin |
||
Ada.Text_IO.Put_Line("Enter X; I'll count from 0 to 2**X in octal"); |
Ada.Text_IO.Put_Line("Enter X; I'll count from 0 to 2**X -1 in octal"); |
||
IIO.Get(X); |
IIO.Get(X); |
||
for I in 0 .. 2**X -1 loop |
for I in 0 .. 2**X -1 loop |
||
Line 18: | Line 18: | ||
Output: |
Output: |
||
<pre>>./octal |
<pre>>./octal |
||
Enter X; I'll count from 0 to 2**X in octal |
Enter X; I'll count from 0 to 2**X -1 in octal |
||
5 |
5 |
||
8#0# 8#1# 8#2# 8#3# 8#4# 8#5# 8#6# 8#7# 8#10# 8#11# 8#12# 8#13# 8#14# 8#15# 8#16# 8#17# 8#20# 8#21# 8#22# 8#23# 8#24# 8#25# 8#26# 8#27# 8#30# 8#31# 8#32# 8#33# 8#34# 8#35# 8#36# 8#37#</pre> |
8#0# 8#1# 8#2# 8#3# 8#4# 8#5# 8#6# 8#7# 8#10# 8#11# 8#12# 8#13# 8#14# 8#15# 8#16# 8#17# 8#20# 8#21# 8#22# 8#23# 8#24# 8#25# 8#26# 8#27# 8#30# 8#31# 8#32# 8#33# 8#34# 8#35# 8#36# 8#37#</pre> |