Application Development 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: 

Write statement question.

Former Member
0 Kudos

Hi-

Can anyone explain me why for the following question the correct answer is :line2.

Q: On what line does the output 'AAAA' appear?

-


REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

Thanks.

ramesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi ananth,

if u write like this,

REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE: / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

the answer is 9th line because i mention here chain statement here ( at the write statemet,

if we write as u written then ans is second line.

reward points if helpful.

regards,

seshu.

8 REPLIES 8

former_member491305
Active Contributor
0 Kudos

ANS: in Second (2nd) line.

former_member194669
Active Contributor
0 Kudos

Hi,


WRITE / ' '.
the above statement will not add a line . 

so SKIP statement will skip the line to 2 from 1

then Write 'AAAA' comes in line 2.

aRs

Former Member
0 Kudos

Hi

AAAA will get printed in the 2nd line why bcoz u have given skip there.

Write:/ ' ' will not insert any blank line.

Regards

Haritha.

former_member583013
Active Contributor
0 Kudos

On Line 9.


DO 8 TIMES.
WRITE / ' '.
ENDDO.

Write 8 lines...


SKIP.

Skip 1 line....So we got 9 lines....


WRITE 'AAAA'.

Doesn't have a skip or "/" so, it's printed on line 9.

Greetings,

Blag.

Former Member
0 Kudos

hi ananth,

if u write like this,

REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE: / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

the answer is 9th line because i mention here chain statement here ( at the write statemet,

if we write as u written then ans is second line.

reward points if helpful.

regards,

seshu.

0 Kudos

Seshu - I tried your code and it printed on the second line not the ninth..

I think the blank lines setting controls the printing in this case.

Rob

0 Kudos

Hi,

I think multiple skip will not generate a blank line.

regards,

sarath

Former Member
0 Kudos

Because the default for BLANK LINES is OFF. Try:


SET BLANK LINES ON.
DO 8 TIMES.
  WRITE / ' '.
ENDDO.
SKIP.
WRITE 'AAAA'.

Rob