...

Programming languages - C++

Back to Course

Lesson Description


Lession - #43 C++ Decision Making


Decision making structures expect that the programmer indicate at least one conditions to be assessed or tried by the program, alongside an statement or statements to be executed assuming the not set in stone to be true, and alternatively, different statements to be executed condition that the not entirely settled to be false.

Following is the general type of a normal making structure saw as in the greater part of the programming languages −



C++ programming language provides following types of decision making statements.

Sr.No Statement and Description
1 if statement
An 'if' statement comprises of a boolean articulation followed by at least one explanations.
2 if...else statement
An 'on the off chance that' proclamation can be trailed by a discretionary 'else' statement, which executes when the boolean articulation is misleading.
3 switch statement
A 'switch' statement permits a variable to be tried for balance against a rundown of values.
4 nested if statements
You can utilize one 'if' or the consequences will be severe 'if' statementinside another 'if' or something bad might happen 'if' statement(s>
.
5 nested switch statements
You can utilize one 'switch' statementinside another 'switch' statement(s>
.

 

 

The ? : Operator

 

 

Exp1 ? Exp2 : Exp3;

 


Exp1, Exp2, and Exp3 are articulations. Notice the utilization and position of the colon.

The value of a '?' articulation is resolved this way: Exp1 is assessed. In the event that it is true, Exp2 is assessed and turns into the trueof the whole '?' articulation. On the off chance that Exp1 is false, Exp3 is assessed and its value turns into the value of the articulation.

 

 

 

 

 

 

C++ meaning "C plus plus," is a programming language that was built off the C language.

 

 

 

 

 

 

C++ Programming Examples · Add two Numbers · Check Leap Year or Not · Make Simple Calculator · Interchange Digits of Number ·

 

 

Borland Turbo C is a discontinued integrated development environment (IDE>
and compiler for the C programming language from Borland.

 

 

C++ 11 is the second major version of C++ and the most important update since C++98.

 

 

The abbreviation of fabs c++ is the floating Absolute, which means the floating-point numeric values.

 

 

geeks for geeks c++ is a general-purpose programming language and is widely used nowadays for competitive programming.