What is a Loop? What are different types of loops in C++?
In C++ loop is used to perform specific repetitive tasks until a condition is satisfied.
TYPES OF LOOPS
1.FOR LOOP
for ( variable initialization; condition; variable update ) {
// Code to execute while the condition is true
}
2. WHILE LOOP
while ( condition )
{
// Code to execute while the situation is true
};
3. DO-WHILE LOOP
do {
} while ( condition );
BY Best Interview Question ON 26 Jan 2019