10/22/2023 0 Comments While loop javascript![]() The body loop can be executed repeatedly for a specified number of times or until the given condition remain true.Ī variable, which is used in the loop statement to control the number of repetition of loop, is known as loop control variable, the loop control variable is always initialized outside the body of loop( or before to execute the loop statement), so that the condition of loop becomes true. The statements that are executed repeatedly are called body of loop. Loop statements are used to execute a set of statements repeatedly. The mechanism through which a set of statements (or single statement) can be executed repeatedly until the given condition becomes true is called loop. ![]() Differences between JavaScript while loop and JavaScript do-while loop:.Example write code to calculate the factorial of an integer by using JavaScript ‘do-while’ loop:.Example write JavaScript code to print the multiplication table of a given number by using ‘do-while’ loop:.The flowchart of JavaScript do-while loop:.Example write codes which reverse the order of the input integer using JavaScript while loop:.Example write code to calculate the nth power of a number n, i.e.Example write code to print the squares and cubes of number from 2 to 7 using javascript while loop:. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |