This is an example program using operators
program Using_Operators;
uses
SysUtils;
begin
// Insert user code here
writeln('7 + 8 = ', 7 + 8);
writeln('7 - 8 = ', 7 - 8);
writeln('7 x 8 = ', 7 * 8);
writeln('15 : 3 = ', 15/3:0:0);
{ :0:0 is for formatting. You should try to ommit it }
{ and see what happend at the result }
writeln('17 mod 4 = ', 17 mod 4);
writeln('17 div 4 = ', 17 div 4);
writeln('3 + 2 x 4 = ', 3 + 2 * 4); // see the different between
writeln('(3 + 2) x 4 = ', (3 + 2) * 4); // these two expressions
writeln(8 shr 1); // logic operator
writeln(8 shl 1); // logic operator
writeln(1 = 2); // boolean operator
writeln(not (1 = 2)); // boolean operator
writeln(7 >= 2); // relational operator
writeln('a' < 'b'); // relational operator
writeln('123delphicodes' = '123delphicodes'); // string operator
writeln('123DelphiCodes' = '123delphicodes'); // string operator
writeln('123DelphiCodes' < '123delphicodes'); // string operator
readln; // wait until enter button is pushed
end.
makasih ya atas sharingnya kawan
ReplyDeletemoga sukses selalu dan tetap semangat
apakah ini?
ReplyDeletesaya tidak mengetahui arti dari ejaan rtersebut.tapi tetep saja saya komentar.wkwkwk
maturtengkiyu sobat,sudah berbagi informasi....