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.

How to Setup Clojure, Leiningen and LightTable setup on Windows

Clojure is a dynamic functional programming language which is designed to combine approachability and interactive development of a scripting language with an efficient and robust infrastructure for multi-threaded programming. Leiningen is a software used for automating Clojure projects. Basically, a easier way to use Clojure.

Exception Handling in C++ Programming

Exceptions are runtime anomalies that a program encounters during execution. It is a situation where a program has an unusual condition and the section of code containing it can’t handle the problem. Exception includes condition such as division by zero, accessing an array outside its bound, running out of memory, etc.

Structure and Sections of a C++ Program

A C++ program can structurally be divided into different sections. Most sections are present by convention for developers to better understand a program. But there are some, which need to be followed in the order given. Primarily, a C++ program can be divided into

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.

do-while loop in C++ Programming

In C++ programming, loop is a process of repeating a group of statements until a certain condition is satisfied. Do-while loop is a variant of while loop where the condition isn’t checked at the top but at the end of the loop, known as exit controlled loop.

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.