Anonymous user
Bitwise operations: Difference between revisions
→{{header|Ada}}: Added missing pieces from Bitshift task
(→{{header|J}}: Added functions to complete expanded requirements.) |
(→{{header|Ada}}: Added missing pieces from Bitshift task) |
||
Line 7:
The following program performs all required operations and prints the resulting values in base 2 for easy checking of the bit values.
<ada>
with Interfaces; use Interfaces;
procedure Bitwise is
package Byte_Io is new Ada.Text_Io.Modular_Io(Byte);
A : Byte := 255;
X : Byte := 128;
N : Natural := 1;
begin
Put_Line("A and B = "); Byte_Io.Put(Item => A and B, Base => 2);
|