Оцените презентацию от 1 до 5 баллов!
Тип файла:
ppt / pptx (powerpoint)
Всего слайдов:
7 слайдов
Для класса:
1,2,3,4,5,6,7,8,9,10,11
Размер файла:
85.77 kB
Просмотров:
54
Скачиваний:
0
Автор:
неизвестен
Слайды и текст к этой презентации:
№1 слайд![Decision structure in C](/documents_6/d9deb2371b2d927349708c6c0074f856/img0.jpg)
Содержание слайда: Decision structure in C++
№2 слайд![Let there are multiple](/documents_6/d9deb2371b2d927349708c6c0074f856/img1.jpg)
Содержание слайда: Let there are multiple statements in the code. This program provides an ability to the programmer to decide what statements to be executed and what statements should not be executed depending upon the specific condition. This is known as decision making
№3 слайд![Decision-making is an](/documents_6/d9deb2371b2d927349708c6c0074f856/img2.jpg)
Содержание слайда: Decision-making is an important concept in any programming language and to accomplish this, C++ uses the following decision making statements:
if statement
if..else statement
switch statement
conditional operator
№4 слайд![IF statement if statement](/documents_6/d9deb2371b2d927349708c6c0074f856/img3.jpg)
Содержание слайда: IF statement
if statement allows us to control a program whether to execute specific statement or not.
If statement is used to complete an operation, if a condition is true
Condition can be true or false
The condition will be checked and if it is true then the statement will be executed.
№5 слайд![IF ELSE statement The](/documents_6/d9deb2371b2d927349708c6c0074f856/img4.jpg)
Содержание слайда: IF…ELSE statement
The if...else executes body of if when the condition is true and executes the body of else if condition is false.
№6 слайд![SWITCH statement. Allows](/documents_6/d9deb2371b2d927349708c6c0074f856/img5.jpg)
Содержание слайда: SWITCH statement.
Allows selection among multiple sections of code, depending on the value of an integral expression.
A switch statement includes one or more switch sections. Each switch section contains one or more case labels followed by one or more statements.
№7 слайд![Сonditional operator ? The](/documents_6/d9deb2371b2d927349708c6c0074f856/img6.jpg)
Содержание слайда: Сonditional operator (? :)
The conditional operator (? :) is a ternary operator (it takes three operands).
The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.
If the first operand evaluates to true (1), the second operand is evaluated.
If the first operand evaluates to false (0), the third operand is evaluated.
The result of the conditional operator is the result of whichever operand is evaluated — the second or the third. Only one of the last two operands is evaluated in a conditional expression.