I need a program in java | Sololearn: Learn to code for FREE!


I need a program in java

If a program run in for loop than that program doesn't run in while loop. Or if that same program run in while loop that doesn't run in for loop. (these two condition will satisfy in one program)

8/14/2022 7:25:27 AM

Prince Raj

2 Answers

New Answer


If I understand what you want correctly, you could add a boolean condition in each loop that once the loop is used, the boolean changes and doesn't allow the next loop to execute.


Loops will be covered in the sololearn Java course: https://www.sololearn.com/Course/Java/?ref=app It is not clear to me what you try to achieve.