Mohana Mahalingam wrote:
1)When I execute the above program, answer is
Value2found at2,0
Can you explain how the value 2,0 is obtained when Break Parent_Loop is replaced with Break statement?
2) When I execute the same with Continue parent_Loop the same answer is obtained.
Can we consider break and labelled Continue statements as the same?
3) When the program is executed with Continue statement, the answer is Value found at 2,1.
Please provide explanations how these statements are working
Thanks in advance
hmmm... These are basics as everyone advised,
you should try it to get yourself using pencil paper or
learning about them, in your case, you should learn more about
break and
continue.
You seem to be not able to understand break and continue.
I will try to provide pointers here, you have to explore more by yourself.
break :
break is used to come out of the immediate loop on meeting some condition.
break with label will come out of the labelled loop on meeting some condition.
continue :
continue is used to skip the rest of the execution on meeting some condition, and makes the program to execute the next iteration in your loop.
All the best