C
C#14mo ago
mrmiyagi

❔ PASCAL While Statement

PROCEDURE DisplayBFTable(minA, maxA: INTEGER; VAR result: INTEGER);
VAR
bRange: INTEGER;
BEGIN
bRange:= 0;
WHILE minA <= maxA DO BEGIN
WHILE bRange <= bTable DO BEGIN
result:= Binomial(minA,bRange);
WriteLn('Ergibt: ', result);
bRange:= bRange + 1;
END;
minA:= minA + 1;
END;
END;
PROCEDURE DisplayBFTable(minA, maxA: INTEGER; VAR result: INTEGER);
VAR
bRange: INTEGER;
BEGIN
bRange:= 0;
WHILE minA <= maxA DO BEGIN
WHILE bRange <= bTable DO BEGIN
result:= Binomial(minA,bRange);
WriteLn('Ergibt: ', result);
bRange:= bRange + 1;
END;
minA:= minA + 1;
END;
END;
Thats my "Function" in Pascal
No description
No description
13 Replies
mrmiyagi
mrmiyagiOP14mo ago
The first one is my result, the second pic is how my result should look like. My Problem is that my while exits after it finishes the first row. Instead adding +1 to my minA and doing the whole thing again
Angius
Angius14mo ago
uh This is a C# server
mrmiyagi
mrmiyagiOP14mo ago
No description
Tvde1
Tvde114mo ago
what's bTable? you probably want to reset bRange after you end the inner iteration
mrmiyagi
mrmiyagiOP14mo ago
its a constant thats my problem
Tvde1
Tvde114mo ago
move the line bRange:= 0 one down
mrmiyagi
mrmiyagiOP14mo ago
Thanks pepepray
Tvde1
Tvde114mo ago
I can now say I helped someone with their Pascal homework
Angius
Angius14mo ago
Screenshot this thread, it's a once in a lifetime event that you see Pascal in the wild
Moods
Moods14mo ago
Actually insane
mindhardt
mindhardt14mo ago
You definetely know nothing about russian schools kekw
Omnissiah
Omnissiah14mo ago
one day i helped my sister with pascal
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server