Professional Documents
Culture Documents
Assignment 3
Assignment 3
Assignment 3
In the study of logic, there are two types of statements, conditional statement and bi-conditional
statement.
These statements are formed by combining two statements, which are called compound
statements.
Suppose a statement is- if it rains, then we don't play.
This is a combination of two statements. These types of statements are mainly used in
computer programming languages such as c, c++, etc.
4. Enumerate and discuss the different Conditional Statement in C++.
Answer:
● Use if to specify a block of code to be executed, if a specified condition is true
● Use else to specify a block of code to be executed, if the same condition is false
● Use else if to specify a new condition to test, if the first condition is false
● Use switch to specify many alternative blocks of code to be executed