Senin, 09 April 2012

pascal syntax (nilai kuadran)


uses wincrt;
var a,b: integer;
    x:0..1;
    label lagi;
begin
     lagi:
     write('Masukkan Bilangan X = '); readln (a);
     write('Masukkan Bilangan Y = '); readln (b);
     if ((a<0) and (b>0)) then
        begin
             writeln ('Kuadran I');
        end;
     if ((a>0) and (b>0)) then
        begin
             writeln ('Kuadran II');
        end;
     if ((a>0) and (b<0)) then
        begin
             writeln ('Kuadran III');
        end
     else
     if ((a<0) and (b<0)) then    
        writeln ('Kuadran IV');
        writeln;
        write('Apakah mau mencoba lagi <1:ya, 0:tidak>?');
        readln (x);
        if x=1 then goto lagi;
   
end.

Tidak ada komentar:

Posting Komentar