Pascal's triangle: Difference between revisions
Content added Content deleted
(+Stata) |
(Microsoft Small Basic) |
||
Line 2,983: | Line 2,983: | ||
pascaltr(4); |
pascaltr(4); |
||
end</lang> |
end</lang> |
||
=={{header|Microsoft Small Basic}}== |
|||
{{trans|GW-BASIC}} |
|||
<lang microsoftsmallbasic> |
|||
TextWindow.Write("Number of rows? ") |
|||
r = TextWindow.ReadNumber() |
|||
For i = 0 To r - 1 |
|||
c = 1 |
|||
For k = 0 To i |
|||
TextWindow.CursorLeft = (k + 1) * 4 - Text.GetLength(c) |
|||
TextWindow.Write(c) |
|||
c = c * (i - k) / (k + 1) |
|||
EndFor |
|||
TextWindow.WriteLine("") |
|||
EndFor |
|||
</lang> |
|||
Output: |
|||
<pre> |
|||
Number of rows? 7 |
|||
1 |
|||
1 1 |
|||
1 2 1 |
|||
1 3 3 1 |
|||
1 4 6 4 1 |
|||
1 5 10 10 5 1 |
|||
1 6 15 20 15 6 1 |
|||
</pre> |
|||
=={{header|NetRexx}}== |
=={{header|NetRexx}}== |