I'm currently trying to program Pascal's triangle and have no clue how to go about doing it
Iknow what the triangle does, how it is formed, and most things about it but have no clue how to convert it into a program to do it for me
I know people don't just like to give out programs to random newbs like me, but any help would be greatly appreciated (even if its just the beginning of the code)
Thanks
Pascal's Triangle Help
Pascal's Triangle
The fun in programming is learning to do it and seeing positive results.
Start with an array and a loop. Make the array as big as you need it to be for the final row of the triangle.
Start with a two element array consisting of 1, 1.
Within the loop reproduce the first array element, then compute (and print) element 1+2, 2+3, 3+4 etc. until you come to the end of the row for that pass thru the loop. You'll have to test for this or be real clever with minding your loop index. The last element of the row will be the last element of the last row + zero, which will just reproduce the last element again, "1".
Be sure to test or loop carefully so you don't go beyond the limit of your array dimension.
If you don't know how to work with arrays or loops, better check out a tutorial first!
Good luck, and happy computing!
Start with an array and a loop. Make the array as big as you need it to be for the final row of the triangle.
Start with a two element array consisting of 1, 1.
Within the loop reproduce the first array element, then compute (and print) element 1+2, 2+3, 3+4 etc. until you come to the end of the row for that pass thru the loop. You'll have to test for this or be real clever with minding your loop index. The last element of the row will be the last element of the last row + zero, which will just reproduce the last element again, "1".
Be sure to test or loop carefully so you don't go beyond the limit of your array dimension.
If you don't know how to work with arrays or loops, better check out a tutorial first!
Good luck, and happy computing!
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
--- Time flies like an arrow, but fruit flies like a banana ---