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

CPP Data Types

CPP Data Types are used to define the type of data that is to be stored. CPP data types can be classified into 4 groups: Basic Data Types: Integer Float Double Character Derived Data Types: Array Pointer Enumeration Data Types: Enum User Defined Data Types: Structure   Basic Data Types: Integer: All the non-decimal numbers … Read more

Categories CPP

CPP Variable

A variable is a temporary memory location that holds its data temporarily. CPP requires the data type of the variable to be well defined at the time of variable declaration, depending on its value. Syntax: data_type variable_list; Rules for using CPP Variables: CPP Variable name starts with a letter or underscore only; numbers and special … Read more

Categories CPP

CPP cout, cin, endl

CPP provides predefined input/output objects and functions to control the flow of data from device to memory and from memory to device. CPP cout: CPP cout is an inbuilt library object of ostream class, which is used for output. The cout object is defined in iostream.h (header file) in CPP library. CPP cout is used … Read more

Categories CPP