Nested loops in C++ Programming

A loop inside another loop is called a nested loop. The number of loops depend on the complexity of a problem. Suppose, a loop, outer loop, running n number of times consists of another loop inside it, inner loop, running m number of times. Then, for each execution of the outer loop from 1...n, the inner loop runs maximum of m times.

for loop in C++ Programming

In C++ programming, loop is a process of repeating a group of statements until a certain condition is satisfied. Like while loop, for loop is an entry controlled loop, where entry controlled means the condition is checked at the beginning of loop. For loop is suitable to use when the number of times a loop runs is known or fixed.

while loop in C++ Programming

In every programming language including C++, loop is a process of repeating a group of statements until a certain condition is satisfied. While loop is an entry controlled loop where the condition is checked at the beginning of the loop. The condition to be checked can be changed inside it. The control can exit a loop in two ways, when the condition becomes false or using break statement.

switch...case statement in C++ Programming

The switch...case statement is a multiple branching statement where the control is transferred to one of the many possible conditions by checking the value of a variable or an expression. The switch statement consists of different cases inside it and the statements inside the case matching the condition is executed. If no cases are matched, the statements inside default block are executed.

if statements in C++ Programming

While writing computer programs, we need to check certain condition to instruct the program to branch accordingly. Like most of the programming languages, C++ has if statement to check the condition and make decision. Based on the number of conditions to be checked, we have different types of if statement. They are

Inline function in C++ Programming

Inline function is a function which when invoked requests the compiler to replace the calling statement with its body. A keyword inline is added before the function name to make it inline. It is an optimization technique used by the compilers as it saves time in switching between the functions otherwise. Member functions of a class are inline by default even if the keyword inline is not used.

Pages