View previous topic :: View next topic
|
Author |
Message |
sindhuvava Currently Banned New User
Joined: 05 Dec 2006 Posts: 17 Location: Chennai
|
|
|
|
Can anyone give me the right answer for the following:
PERFORM VARYING X FROM 1 BY 1 UNTIL X<3
MOVE X TO A
END-PERFORM.
How many times the above code will be executed? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sindu,
Quote: |
How many times the above code will be executed? |
What does the manual say?
If you still dint get the answer, IMPLEMENT and see how many times it gets executed. |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
The loop will not execute.
First time X=1 and X<3 the condition satisfied. It does not enter the loop at all. Correct me, If I am wrong. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Yes, Loop will not execute at all as in the first case itself condition is getting satisfied.
KSK |
|
Back to top |
|
|
sindhuvava Currently Banned New User
Joined: 05 Dec 2006 Posts: 17 Location: Chennai
|
|
|
|
Yes u r right,i checked it out.
Thank You |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sindhu,
Good. You could have done before. |
|
Back to top |
|
|
|