but it does have a while loop construct which uses the keywords "do while" and is thus actually the same as the for loop. program FactorialProg integer :: counter = 5 integer :: factorial = 1 factorial = factorial * counter counter = counter - 1 do while (counter > 0) ! Truth value is tested before the loop factorial = factorial * counter counter = counter - 1 end do print *, factorial end program FactorialProg Java int counter = 5; int factorial = 1; do { factorial *= counter--; /* Multiply, then decrement. */ } while (counter > 0); System.out.println("The factorial of 5 is " + factorial); //============================================// // The below function does the same as above. // //============================================// int counter = 5; int factorial = 1; while (counter > 0){ factorial *= counter--; /* Multiply, then decrement. */ } System.out.println("The factorial of 5 is " + factorial); JavaScript let counter = 5; // Declaring two variables, counter and factorial let factorial = 1; do { factorial *= counter--; //What will be looped } while (counter > 0); //The looping conditions console.log(factorial); //Showing the result Kotlin var counter = 5 var factorial = 1 //These line of code is almost the same as the above JavaScript codes, the only difference is the keyword that shows the results do { factorial *= counter-- } while (counter > 0) println("Factorial of 5 is $factorial") Pascal Pascal does not have a do/while; instead, it has a repeat/until. As mentioned in the introduction, one can consider a repeat/until to be equivalent to a 'do code while not expression' construct. factorial := 1; counter := 5; repeat factorial := factorial * counter; counter := counter - 1; // In Object Pascal one may use dec (counter); until counter = 0; PHP $counter = 5; $factorial = 1; do { $factorial *= $counter--; } while ($counter > 0); echo $factorial; PL/I The PL/I DO statement subsumes the functions of the post-test loop (do until), the pre-test loop (do while), and the for loop. All functions can be included in a single statement. The example shows only the "do until" syntax. declare counter fixed initial(5); declare factorial fixed initial(1); do until(counter <= 0); factorial = factorial * counter; counter = counter - 1; end; put(factorial); Python Python lacks a specific do while flow control construct. However, the equivalent may be constructed out of a while