Numerical Triangle (Sample Programs)

by lrcvs, Friday, August 02, 2013, 17:16 (1514 days ago)

http://es.answers.yahoo.com/question/index;_ylt=AiDP4ulWAM.bTNI55dYaOoZp.gt.;_ylv=3?qid...

Traduction:

Numerical Triangle:

How to make a program that shows a figure?
Create a program calling for the limit n print the following:
For example n = 4 then would:

1
1 2
1 2 3
1 2 3 4
1 2 3
1 2
1

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

n = 8 #limit number

for a = 1 to n
j$ = ""
for b = 1 to a
j$ = j$ + string(b)
next b
print j$
j$ = ""
next a

for a = n to 0 step -1
j$ = ""
for b = 1 to a-1
j$ = j$ + string(b)
next b
print j$
next a
print
end

::::::::::::::::::::::::::::::::::::::::::::::::::::::::

1
12
123
1234
12345
123456
1234567
12345678
1234567
123456
12345
1234
123
12
1

(ERROR en linea14: Illegal FOR -- start number > end number ) Why?


Complete thread:

 RSS Feed of thread

powered by my little forum