CPP Goto

CPP goto statement is used to jump to an specified label in the code every time, without any condition. Syntax: loop/conditions statements { statements; goto; }   Example: #include <iostream.h> using namespace std;   int main() { int n; cout << "Enter a number: "; cin >> n; if (n < 5) goto less; else … Read more

Categories CPP

CPP Continue

CPP Continue statement is used to skip the execution of current iteration in between the loop. Continue statement controls the containing loop only, i.e, external loops will not get affected because of Continue statement in inner loop.   Syntax: loop/conditions statements { statements; continue; }   Example: #include <iostream.h> using namespace std; int main() { … Read more

Categories CPP

CPP Break

CPP break statement is used to break the execution of current loop in between the loop or to prevent the code to check the next switch case. Break statement breaks the continuity of the containing loop only, i.e, external loops will not get affected because of Break statement in inner loop.   Syntax:   loop/conditions … Read more

Categories CPP

CPP Do While Loop

CPP Do While Loop is a loop statement which is used to execute a block of code continuously as long as the condition of the loop is true, and stops only when the condition fails like other loop statements. The unique feature of Do While loop is that it is used to execute a block … Read more

Categories CPP

CPP While Loop

CPP While Loop is a loop statement which can be used in various forms to execute a block of code continuously as long as the condition of the loop is true, and stops only when the condition fails. These are: While Loop : While loop is used to execute a group of action as long … Read more

Categories CPP

CPP For Loop

CPP For Loop is a loop statement which can be used in various forms to execute a block of code continuously as long as the condition of the loop is true, and stops only when the condition fails. These are: For Loop : For loop is used to execute a group of action only for … Read more

Categories CPP

CPP Switch

CPP Switch statement is a conditional statement, which is used to choose one of the action to perform from the multiple actions, relative to the true condition. Syntax: switch (expression) { case value1:           code to be executed if expression=value1; break;   case value2:             code to be executed if expression=value2; break;   case value3: … Read more

Categories CPP

CPP If Else

CPP If Else statement is a conditional statement, which can be used in various forms to check a condition or multiple conditions and to perform the specified action or actions, if the particular condition is true. These are:   if : If statement is used to perform an action if a single condition is true. … Read more

Categories CPP

CPP Operators

CPP Operators are used to perform operations on operands. Operands can be a variable or a constant. The operators are divided into various groups on the basis of the basic operations they perform.   Some of the basic operators are: Arithmetic Operators: The operators which are used to perform the arithmetical operations, are grouped together … Read more

Categories CPP

CPP Keywords

There are a list of words already defined in CPP library, same as in C. These reserved words are called as CPP Keywords. Every keyword is defined to serve a specific purpose. These keywords when used in CPP codes performs a specific operation during compilation. A Keyword in CPP is restricted to be used as … Read more

Categories CPP