06-12-2007 4:15 PM
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.
06-12-2007 4:25 PM
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.
06-12-2007 4:19 PM
06-12-2007 4:23 PM
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
06-12-2007 4:23 PM
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.
06-12-2007 4:24 PM
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.
06-12-2007 4:25 PM
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.
06-12-2007 5:03 PM
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
07-21-2007 9:53 AM
Hi,
I think multiple skip will not generate a blank line.
regards,
sarath
06-12-2007 4:41 PM
Because the default for BLANK LINES is OFF. Try:
SET BLANK LINES ON.
DO 8 TIMES.
WRITE / ' '.
ENDDO.
SKIP.
WRITE 'AAAA'.
Rob