text: C++ Loops
  There may be a situation when we need to execute a block of the program several times. Therefore, In a programming language, loops are used when we need to execute a block of statements repeatedly.
  The following is the general from of a loop statement:
  There are mainly two types of Loops:
  - Entry Controlled loops: The test condition is tested before entering the loop body. While Loop and For Loop is entry-controlled loops.
  - Exit Controlled Loops: The test condition is tested at the end of the loop body. Hence, the loop body will execute at least once, irrespective of whether the test condition is true or false. The do-while loop is exit controlled loop.
  Concept of Loop statements
  C++ While Loop
  Syntax:
  while (condition) { // body of the loop }
  - A
  whileloop assess the
  condition
  - If the
  conditionassessment is
  true, the code inside the
  whileloop is executed.
  - Then the
  conditionis assessed again.
  - This process continues until the
  conditionassessment is
  false.
  - When the
  conditionassessment is
  false, the loop terminates.
  C++ for LOOP
  for (initialization; condition; update) { // body of-loop }
  Here,
  initialization– Variable is initialized and is executed only once
  condition– If the assessment of the condition is
  true, the body of
  forloop is executed and
  if
  false, the for loop gets terminated
  update– Updates the value of initialized variables and checks the condition again
  C++ do…while loop
  Here,
  - At first, the body of the loop is executed. Then the condition is evaluated.
  - If the evaluation of the condition is true, the body of the loop inside the do statement is executed again.
  - The
  conditionis evaluated again.
  - If the
  conditionassessment is
  true, the body of the loop inside the
  dostatement is executed again.
  - This process keeps repeating until the
  conditionevaluates to
  false. Then the loop terminates.
  Loop Control Statements
  Loop control statements change the execution of the program from their normal sequence.
  Following are the control statements in C++:
  The Infinite Loop
  A loop becomes an infinite loop if the evaluation of the condition is never false.
  Example:
  #include <iostream> using namespace std; int main(){ for(int i=1; i>=1; i++){ cout<<"GeeksGod"<<endl; } return 0; } OUTPUT ------ GeeksGod GeeksGod GeeksGod GeeksGod GeeksGod GeeksGod GeeksGod ...
  Also,
  #include <stdio.h> int main() { for(;;) // Absent Condition { printf("GeeksGod\n"); } return 0; }
  When the conditional expression is absent, it is assumed to be true.