Both for loop and while loop is used to execute repeated statements. 'For loop' is used when the number of iterations is known, whereas the 'while loop' is executed until the loop condition statement fails. As per definition while loop is mentioned as infinite, but the programmer will anyway specify the terminating condition or use appropriate break statements to exit the loop.
👏
Mam for loop is finite
While loop is infinite correct a mam.
Both for loop and while loop is used to execute repeated statements. 'For loop' is used when the number of iterations is known, whereas the 'while loop' is executed until the loop condition statement fails. As per definition while loop is mentioned as infinite, but the programmer will anyway specify the terminating condition or use appropriate break statements to exit the loop.