Is it possile to use loop as part of the body of another while loop, what it indicates?
Answers
Answered by
0
Answer:
Yes
Explanation:
It is completely possible to use loop as a part of the body of another loop. Then the body of while loop here in the example will be called as nested loop. It is used to repeat a loop upto a limit or infinite.
Example :
int i, j;
i = 1;
while(i <= 5)
{
for(j = 1; j <= 2; j++)
{
System.out.println("Hello");
}
i++;
}
Output :
Hello will print 10 times
Similar questions