Bitwise operations: Difference between revisions

Content added Content deleted
No edit summary
m (→‎{{header|Ada}}: added code highlighting)
Line 8: Line 8:
The following program performs all required operations and prints the resulting values in base 2 for easy checking of the bit values.
The following program performs all required operations and prints the resulting values in base 2 for easy checking of the bit values.


with Ada.Text_Io; use Ada.Text_Io;
<ada> with Ada.Text_Io; use Ada.Text_Io;
procedure Bitwise is
procedure Bitwise is
Line 21: Line 21:
Put("A xor B = "); Byte_Io.Put(Item => A xor B, Base => 2); New_Line;
Put("A xor B = "); Byte_Io.Put(Item => A xor B, Base => 2); New_Line;
Put("Not A = "); Byte_IO.Put(Item => not A, Base => 2); New_Line;
Put("Not A = "); Byte_IO.Put(Item => not A, Base => 2); New_Line;
end bitwise;
end bitwise;</ada>


The output of this program is:
The output of this program is: