posted 21 years ago
Welcome to the Ranch Sarbani. Please see below the link "What is UBB Code?" to ident properly your code.
1)i=0,j=0
2)after point A i=1
3)C prints 1
4)D evalutes to continue label 2. Independently of that j=1 after D
5)continue label 2 will break E, that is, j is still 1. If B had gotten an increment expression it would have been executed.
6)C prints 2
7)D evalutes to continue label 1. After D j=2
8)continue label 1 will break E again, that is, "++j<5" is not executed. If A had gotten an increment expression it would have been executed before "i++<5".
9)In A 1<5 and i=2 after A
10)C prints 4
11)D evalutes to break label 3. After D j=3
12)break label 3 breaks E and the next B iteration begins
13)C prints 5
14)D evaluates to break label 2. After D j=4
15)break label 2 breaks E and B. The next A iteration begins. If A had gotten an increment expression it would have been executed before "i++<5"
16)in A 2<5 and after A i=3
17)C prints 7
18)D evaluates to default. After D j=5
19)break label 1 jumps out of A ending the program.
Hope it helps.
[ March 23, 2003: Message edited by: Jose Botella ]
SCJP2. Please Indent your code using UBB Code