- Beranda
- Komunitas
- Tech
- Programmer Forum
Tolong Jelasin Logika/alur Program Pascal ini
TS
cah.mbeling
Tolong Jelasin Logika/alur Program Pascal ini
ini program buat menampilkan segitiga pascal gan tolong dong jelasin logikanya
/alurnya
Program Segitiga_Pascal;
Uses wincrt;
Var
i,j,n:integer;
x: array[1..100, 1..100] of integer;
Begin
For i:= 1 to 7 do
For j:= 1 to i do
Begin
if j=1 then x[i,j]:=1
else if j=i then x[i,j]:=1
else x[i,j]:=x[i-1,j-1]+x[i-1,j];
End;
For i:= 1 to 7 do
Begin
Gotoxy(40-3*i,2+i);
For j:= 1 to i do
write(x[i,j]:6);
End;
readln;
End.
/alurnya
Program Segitiga_Pascal;
Uses wincrt;
Var
i,j,n:integer;
x: array[1..100, 1..100] of integer;
Begin
For i:= 1 to 7 do
For j:= 1 to i do
Begin
if j=1 then x[i,j]:=1
else if j=i then x[i,j]:=1
else x[i,j]:=x[i-1,j-1]+x[i-1,j];
End;
For i:= 1 to 7 do
Begin
Gotoxy(40-3*i,2+i);
For j:= 1 to i do
write(x[i,j]:6);
End;
readln;
End.
0
1.5K
3
Komentar yang asik ya
Urutan
Terbaru
Terlama
Komentar yang asik ya
Komunitas Pilihan