Book of tasks on programming. Old version

 

 by Aliaksandr N. Prykhodzka

 

void, html, многомерный, промежуточный, восьмеричный, shr, cycle, core, test, лабораторный, function, interruption, not, examples, ряд, clipboard, begin
 

for valuable work you must have JavaScript (allow active content)

Pascal. Pa.2. Nest of tasks. Simple programs

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.1     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=3;    zz:=5;
    xx:=yy+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.2     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=4;    zz:=9;
    xx:=yy+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.3     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=13;    zz:=17;
    xx:=yy+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.4     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=3;    zz:=5;
    xx:=yy+zz;
    xx:=xx+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.5     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=4;    zz:=6;
    xx:=yy+zz;
    xx:=xx+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.6     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=3;    zz:=5;
    xx:=yy+zz;
    xx:=xx*xx;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.7     Answer      Java-analogue

Determine a number produced by this program


Program AA;
var
    xx, yy, zz : integer;
begin
    yy:=3;    zz:=5;
    xx:=yy+zz;
    xx:=xx-2;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.8     Answer      Java-analogue

Determine the result of program if input are numbers 3 and 8


Program AA;
var
    xx, yy, zz : integer;
begin
    readln(yy);
    readln(zz);
    xx:=yy+zz;
    writeln(xx)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.9     Answer      Java-analogue

Determine the result of program if input are numbers 3 and 8


Program AA;
var
    yy, zz : integer;
begin
    readln(yy);
    readln(zz);
    writeln(zz);
    writeln(yy)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.10     Answer      Java-analogue

Determine the result of program if input are numbers 3 and 8


Program AA;
var
    yy, zz : integer;
begin
    readln(yy);
    readln(zz);
    writeln(yy);
    writeln(zz)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.11     Answer      Java-analogue

Determine the result of program if input are numbers 3 and 8


Program AA;
var
    yy, zz : integer;
begin
    readln(yy);
    readln(zz);
    writeln(zz);
    writeln(yy);
    writeln(zz)
end.

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

Pa.2.12     Answer      Java-analogue

Determine the result of program if input are numbers 3 and 8


Program AA;
var
    xx, yy, zz : integer;
begin
    readln(yy);
    readln(zz);
    xx:=yy+zz;
    writeln(xx);
    writeln(xx);
    writeln(xx)
end.

 

©   Aliaksandr Prykhodzka    1993 - 2007