18 lines
431 B
ObjectPascal
18 lines
431 B
ObjectPascal
|
program simple_expressions;
|
||
|
|
||
|
{$mode objfpc}{$H+}
|
||
|
|
||
|
var
|
||
|
b: Byte = 4;
|
||
|
c: Byte = 3;
|
||
|
|
||
|
begin
|
||
|
WriteLn('Initial value of b is ', b, '; initial value of c is ', c, sLineBreak);
|
||
|
b := b shr 1; // >> shift right
|
||
|
c := shl 4; // << shift left
|
||
|
WriteLn('After b shr 1, b is ', b, '; after c shl 4, c is ', c, sLineBreak);
|
||
|
WriteLn('c xor b = ',c xor b, '; c and b = ', c and b, '; c or b,'
|
||
|
{$IFDEF WINDOWS}
|
||
|
ReadLn;
|
||
|
{$ENDIF}
|
||
|
end.
|