Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 1.6 KB

README.md

File metadata and controls

25 lines (14 loc) · 1.6 KB

Conditional-Statements-in-C-

##AIM:To study different conditional statements in C++

##THEORY:

The conditional statements such as if, if else, switch, etc. are used for decision-making purposes in C++ programs.Conditional statements in C++ are programming constructs that allow a program to execute different blocks of code based on whether a certain condition is true or false.The syntax of conditional statements uses relational operators such as:
1.'<' and '>'- less than/greater than
2.'==' and '!=' - equal to/not equal to
3.'<=' and '>=' - less than equal to/greater than equal to

if, if-else , else conditional statements execute the block of codes based on whether the condition is true or false.Meanwhile the switch condition switches between different cases based on the user input.

Screenshot 2023-10-09 213117

##OUTPUTS

even_odd-Screenshot 2023-10-01 135107
largestofthree-Screenshot 2023-10-01 135228
switchcase_1-Screenshot 2023-10-01 135302
switchcase_2-Screenshot 2023-10-01 135340