Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

beautiful_hello

program hello;

procedure sayHello();
var
  text:string = 'Hey everyone out there';
begin
  writeln(text)
end;

begin
  sayHello
end.

okienko

program oknicko;
uses crt;
var a,b,c,d,e:byte;
procedure okno(x,y,dx,dy,f:byte);
var i:integer;
begin
textcolor(f);
for i:=0 to dx-1 do begin
                     gotoxy(x+i,y);
                     write('+');
                     end;
for i:=0 to dx-1 do begin
                     gotoxy(x+i,y+dy-1);
                     write('+');
                     end;
for i:=0 to dy-1 do begin
                     gotoxy(x,y+i);
                     write('+');
                     end;
for i:=0 to dy-1 do begin
                     gotoxy(x+dx-1,y+i);
                     write('+');
                     end; 
writeln;
end;
begin
clrscr;
write('zadaj x: ');
readln(a);
write('zadaj y: ');
readln(b);
write('zadaj dľžku: ');
readln(c);
write('zadaj šírku: ');
readln(d);
write('zadaj farbu: ');
readln(e);
okno(a,b,c,d,e);
readln;
end.

rgwrgf

Program HelloWorld(output);
var
jmeno: string;

begin
write('Zadej jmeno:');
read(jmeno);
writeln;
  writeln('Nazdar',jmeno);
end.

gyuf

program number7;
uses crt;
var A,B,C: integer;
begin
clrscr;
A:=17;
B:=3;
C:=A div B;
writeln ('68 div 10 = ',C);
C:=A div B;
writeln ('65 div 8 = ',C);
C:=A-B;
writeln ('17-3 =',C);
C:=A+B;
writeln ('17+3 =',C);
C:=A mod B;
writeln ('65 mod 8 = ',C);
C:=A mod B;
writeln ('65 mod 8 = ',C);
readln
end.

Compile and Execute Pascal Online

Program Restaurant;
const
    seat=12;{table capacity}
var
    table,guest,remain:integer;
begin
    write('How many guests are invited?');
    readln(guest);
    table:=guest div seat;
    remain:=guest mod seat;
    writeln('Tables required=',table);
    writeln('Guests remaining=',remain);
end.

Compile and Execute Pascal Online

Program FormatOutput;
var
    num:integer;
begin
    num:=3456;
    writeln('1234567890');{a ruler}
    writeln(num:5);
    writeln(num:8);
    writeln(num:2);
end.

Compile and Execute Pascal Online

Program character;
var
    grade,space,quote:char;
begin
    grade:='A';
    space:=' ';
    quote:='''';
    writeln(grade,space,quote);
end.

pascal

var z: integer;
var r, a, b: integer;

x: integer  = 42;
y: integer  =7;
begin
    if y>x then 
    begin
        z:=x;
        x:=y;
        y:=z;
    end;
    a:=x;
    b:=y;
    while b>0 do 
    begin
        r:=a mod b;
        a:=b;
        b:=r;
    end;
    writeln(a);
    writeln(x);
    write(y);
end.

Compile and Execute Pascal Online

program vd2_2;
uses crt;
var N:integer;
begin
repeat 
write('nhap vao so nguyen duong N:');
readln(N);
if (N<=0) then writeln('Ban can hoc lai toan! Lam on nhap so nguyen duong!');
until (N>0);
end.

Compile and Execute Pascal Online

Program HelloWorld(output);
begin
  writeln('Hello, world!');
end.

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.