Nested Do while Loop with 4 Levels

Nested Do while Loop with 4 Levels

This program is a javascript program using 4 levels nested do while loop to solve a program. It contains 4 levels nested do while loop.

Algorithm of Nested Do while Loop with 4 Levels

The algorithm is a step by step procedure to solve a procedure. Let’s see the algorithm to solve the mentioned problem.

  1. Start
  2. Declare Variables
  3. start outer loop
  4. start inner loops
  5. print output ” **”
  6. increment the variable in every loop.
  7. Stop

Pseudo Code of Nested Do while Loop with 4 Levels

  1. tag <script>
  2. Declare & initialize var i
  3. Declare & initialize var j
  4. Declare & initialize var k
  5. Declare & initialize var l
  6. go to inner loop print ” **”
  7. print “\n”
  8. increment l++;
  9. check l<2
  10. print ” **”
  11. print “\n”
  12. l++
  13. check condition false.
  14. out of loop
  15. k++;
  16. check k<2;
  17. print ” **”
  18. print “\n”
  19. k++;
  20. condition k<2 false
  21. out of loop
  22. j++;
  23. check j<2 true
  24. print ” **”
  25. print “\n”
  26. j++
  27. condition j<2 false
  28. out of loop
  29. i++
  30. condition i++ true
  31. print ” **”
  32. print “\n”
  33. i++
  34. condition i<2 false
  35. out of loop

Program of Nested Do while Loop with 4 Levels

Latest posts by Prof. Fazal Rehman Shamil (see all)

Buy advertisement space on T4Tutorials

For more details email [email protected]