Show the (decimal) value of a number of 1s appended with a 3, then squared: Difference between revisions
Show the (decimal) value of a number of 1s appended with a 3, then squared (view source)
Revision as of 19:20, 26 June 2021
, 2 years agoAdded XPL0 example.
(Add Seed7) |
(Added XPL0 example.) |
||
Line 705:
1111113 1234572098769
11111113 123456832098769
</pre>
=={{header|XPL0}}==
Only 32-bit integers are available, but the standard 64-bit floating point (real) provides 15 decimal digits.
<lang XPL0>int N, M;
real X;
[Format(16, 0);
for N:= 0 to 8-1 do
[X:= 0.;
for M:= 0 to N-1 do
X:= X*10. + 1.;
X:= X*10. + 3.;
RlOut(0, X);
RlOut(0, X*X);
CrLf(0);
];
]</lang>
{{out}}
<pre>
3 9
13 169
113 12769
1113 1238769
11113 123498769
111113 12346098769
1111113 1234572098769
11111113 123456832098769
</pre>
|