For loop is a control flow statement for specifying iteration, which allows code to be executed repeatedly. … This allows the body of the for-loop (the code that is being repeatedly executed) to know about the sequencing of each iteration.
The condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and the flow of control jumps to the next statement just after the ‘for’ loop.
A “For” Loop is used to repeat a specific block of code a known number of times.
While loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement.
the code must always be executed first and then the expression or test condition is evaluated. If it is true, the code executes the body of the loop again.
The while loop is used to repeat a section of code an unknown number of times until a specific condition is met.
https://en.wikipedia.org/wiki/While_loop