If then bloğu
program if_then;
uses crt;
var
a,b,sonuc:integer;
begin
writeln('1.deger giriniz');readln(a);
writeln('2.deger giriniz');readln(b);
if a>b then write(a,' ',b, ' den buyuktur');
if a<b then write(a,' ',b, ' den kucuktur');
if a=b then write(a,' ',b, ' ye esittir');
readln;
end.
if a>b then write(a,' ',b, ' den buyuktur');
if [sonuc] then [olay çıktısı yada işlem basamağı]
if then için Bir olayın olma olasığı
sonuç
0
1
if sonuc=0 [a>b için 3>5] then sonuç yorumlanmaz
if sonuc=1 [a>b için 5>3] then sonuç yorumlanır
f sonuc=0 [a<b için 5<3] then sonuç yorumlanmaz
if sonuc=1 [a<b için 3<5] then sonuç yorumlanır
f sonuc=0 [a=b için 3=5] then sonuç yorumlanmaz
f sonuc=1 [a=b için 3=3] then sonuç yorumlanır