Can I put a while loop and another while loop inside it?
Example: // Create a while function while (expr) { ... codes here
// New while inside a while while (expr) { ... codes for the new while
// Close the new while }
// Close the main while }
Yes
However to make the code easier to read for others, you should indent your code properly. With indentation, your example code would look like this:
// Create a while function while (expr) { //code here while (expr) { //codes for } }
Thanks 🙂