Skip to main content

Posts

Featured

Iteration Statements

These type of statements gets executed again and again based on a test condition i.e these are the statements which executes until the given test condition is true. There are three types of loop in C++ : 1. for loop 2. while loop 3. do-while loop (also known as exit control loop   ). All the above listed loop consist of four parts : 1. Initialization expression 2. Test expression 3. Update expression 4. Loop body Lets discuss the syntax and working of each. 1. FOR LOOP syntax: for ( initialization expression ;  test expression ;  update expression )      {          loop body      } NOTE: REMEMBER THE SEMICOLON BETWEEN THREE EXPRESSIONS . example: working: + First declare a variable to hold a value. The declaration can be done inside the for loop as shown above or outside it. In above example we declare an integer variable and at the same time we initialize it to hold an integer value....

Latest Posts

Coding a Simple Calculator

Selection Statements

Operators

Standard input and output streams in C++

Starting with Programming

Data Types in C++

Talking with Basic