Category: c++ flow control

We will learn about goto statement in C programming and how this statement alters the sequential flow of the program execution. goto statement Syntax of got statement: Here, label indicates the location. goto tells the program to jump the code to the location of label and start executing program from that line. Example of goto

We will learn to use switch case statement in C programming. After completing this tutorial you will be able to use switch case in almost any scenario. If we need to choose option using only single value or constant then we use switch statement. Syntax of switch statement: In above code, if the constant is

In this tutorial, we will learn about ‘break and continue in c++’. Continue statement is use to skip the code block inside loop and still continue the loop. Whereas Break statement is used to jump out of the loop completely. Break and continue statements in c++ To be able to understand this tutorial thoroughly, you must have

In this tutorial, we will learn how to execute statements repeatedly using ‘while and do while loop in C++’ , there difference and how and where to use them with examples. There may be a condition in where you will need to execute a block of statement multiple times. Executing the same block of statement multiple time

In this tutorial, we will learn how to execute statements repeatedly using for loop with examples. There may be a condition in which you need to execute a block of statement multiple times. Executing the same block of statement multiple time is called loop. Syntax of for loop: Here’s how the above code will work. The initialization

In this tutorial, we will learn how to use C++ for decision making with example. Syntax of if else statement: If the condition of if statement is correct i.e returns true then the code inside if is executed and the else part is skipped. If the condition of if returns false then code inside else