Previous in Forum: Drag and Drop in HTML   Next in Forum: AutoCAD - Could Not Load plcfmgr.dll
Close
Close
Close
2 comments
Rate Comments: Nested
Active Contributor

Join Date: Nov 2010
Location: Lagos, Nigeria
Posts: 10

Pascal Program to Generate a Pascal Triangle

11/30/2010 6:14 AM

pascal program to generate a pascal triangle

pls i need urgently

__________________
Desire! That's the one secret of every man's career. Not education. Not being born with hidden talents. Desire. - Bobby Unser
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".
2
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#1

Re: Pascal Program to Generate a Pascal Triangle

11/30/2010 7:57 AM

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;

begin

/// 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

begin

Addrow (A);

/// print the row

end;

// pause to observe the wonder

end.

__________________
Never do today what you can put of until tomorrow - Student motto
Register to Reply Good Answer (Score 2)
Power-User
Popular Science - Weaponology - New Member Hobbies - Fishing - New Member

Join Date: Mar 2007
Location: US - NC
Posts: 316
Good Answers: 9
#2
In reply to #1

Re: Pascal Program to Generate a Pascal Triangle

11/30/2010 2:51 PM

Dang Hendrik - you have far more brain cells left than I do

Been over 30 yrs since I utilized Pascal....good job!

Register to Reply
Register to Reply 2 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

Previous in Forum: Drag and Drop in HTML   Next in Forum: AutoCAD - Could Not Load plcfmgr.dll

Advertisement