0% found this document useful (0 votes)
30 views3 pages

TP 6

The document contains 4 Pascal programs. The first program displays a table of even number multiplications from 1 to 10. The second program generates and displays a series of numbers from -5 to n-1 increasing by 3. The third program generates and displays even numbers from 20 to 120 increasing by 2. The fourth program generates and displays odd numbers from 1 to n increasing by 2.

Uploaded by

Hasan Rmb
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

TP 6

The document contains 4 Pascal programs. The first program displays a table of even number multiplications from 1 to 10. The second program generates and displays a series of numbers from -5 to n-1 increasing by 3. The third program generates and displays even numbers from 20 to 120 increasing by 2. The fourth program generates and displays odd numbers from 1 to n increasing by 2.

Uploaded by

Hasan Rmb
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

TUGAS PENDAHULUAN

program perkalian;
uses crt;
var a,b,c,d,e,f : integer;
begin
clrscr;
writeln('DAFTAR PERKALIAN GENAP 1 SAMPAI 10');
writeln;
writeln('==================================');
writeln(' a
x2
x4
x6
x8
x10 ');
writeln('==================================');
for a:= 1 to 10 do
begin
b:= a*2;
c:= a*4;
d:= a*6;
e:= a*8;
f:= a*10;
writeln(a:2,b:6,c:6,d:6,e:6,f:6);
end;
writeln('==================================');
readln;
end.

program x;
uses crt;
var n,i,a : integer;
begin
clrscr;
write('Baca nilai = '); readln(n);
for i := 1 to n do
begin
a := -5+(i-1)*3;
write(a:5);
write;
end;
readln;
end.

program genap;
uses crt;
var n,i,a : integer;
begin
clrscr;
write('baca nilai = '); readln(n);
for i := 10 to 60 do
begin
a := (2*i) + 2;
write(a:5);
write;
end;
readln;
end.

program ganjil;
uses crt;
var n,i,a : integer;
begin
clrscr;
write('baca nilai = '); readln(n);
for i := 1 to n do
begin
a := (2*i) - 1;
write(a:3);
write;
end;
readln;
end.

You might also like