Anonymous user
Host introspection: Difference between revisions
Ada solution added
(→{{header|Python}}: Added hostname) |
(Ada solution added) |
||
Line 3:
Print the [[wp:Word_size#Word_size_choice|word size]] and [[wp:Endianness|endianness]] of the host machine.
=={{header|Ada}}==
<ada>
with Ada.Text_IO; use Ada.Text_IO;
with System; use System;
procedure Host_Introspection is
begin
Put_Line ("Word size" & Integer'Image (Word_Size));
Put_Line ("Endianness " & Bit_Order'Image (Default_Bit_Order));
end Host_Introspection;
</ada>
Sample output on a Pentium machine:
<pre>
Word size 32
Endianness LOW_ORDER_FIRST
</pre>
=={{header|C}}==
<c>#include <stdio.h>
|