I forgot my password.
Don't have an account?
pascal program to generate a pascal triangle
pls i need urgently
This sounds like homwork but also like fun!!
this may not be what is expected and I am really rusty.
type ia = Array[0..102] of integer;
procedure addrow (var r:ia);
VAR I,J:Integer;
H:ia;
begin
I:=2;
while R[i] <> 0 do inc(i); {get positiom of zero at end}
H:=R;
for j:= 1 to UI + 1 do R[j] := H[j-1] + H[j];
end;
var A : ia;
rows , K : integer;
/// input number of rows 2 t0 100 into rows
fillchar (A,sizeof(A),0); {clear matrix}
A[1] :=1;
// print the first row
for K := 2 to Rows do
Addrow (A);
/// print the row
// pause to observe the wonder
end.
Dang Hendrik - you have far more brain cells left than I do
Been over 30 yrs since I utilized Pascal....good job!
Good Answers: