Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Program

Former Member
0 Likes
784

Hi frnds,

i m trying hard with this logic but i m not getting.

1

1 1

1 1 1

1 1 1 1

1 1 1 1 1

i hav written but not getting... CAN ANYONE THROW SOME LIGHT ON THIS...

Looking for ur hlp.

regards,

suraj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
764

Hi,

see this code.

data:n type n.

do 5 times.

n = sy-index.

write:/ .

do n times.

write: '1'.

enddo.

enddo.

rgds,

bharat.

6 REPLIES 6
Read only

Former Member
0 Likes
764

well what is your requirement?

to display such a triangle of 1´s?

Read only

Former Member
0 Likes
764

You want to print this on a program?


1
1 1
1 1 1
1 1 1 1
1 1 1 1 1

Not sure why you need it....But try this -:)


DATA: CHARS TYPE STRING.

CHARS = '1'.

DO 5 TIMES.
WRITE:/ CHARS.
CONCATENATE CHARS '1'
INTO CHARS.
ENDDO.

Greetings,

Blag.

Read only

0 Likes
764

wow great approach, while i had a quick thought on it, my imaginary code was some lines longer^^

Read only

0 Likes
764

Hi Florian:

I do something like that a long time on Euphoria...So it wasn't hard for me to remember how I do it -;)

Please close the thread and give points is it was helpfull -:D

Greetings,

Blag.

Read only

Former Member
0 Likes
765

Hi,

see this code.

data:n type n.

do 5 times.

n = sy-index.

write:/ .

do n times.

write: '1'.

enddo.

enddo.

rgds,

bharat.

Read only

Former Member
0 Likes
764

hi

copy the code.

REPORT Z_71945_TEST.

data: a type i value 1,

count type i value 1.

do 5 times.

if count = 1.

write :a.

count = count + 1.

endif.

if count = 2.

write 😕 a,a .

count = count + 1.

endif.

if count = 3.

write 😕 a,a,a .

count = count + 1.

endif.

if count = 4.

write 😕 a,a,a,a .

count = count + 1.

endif.

if count = 5.

write 😕 a,a,a,a,a .

count = count + 1.

endif.

enddo.

regards

ravish

<i><b>plz dont forget to reward points if helpful</b></i>