CSCI 1111 Chapter Notes - Chapter 3: Bitwise Operation, Switch Statement, Operand

45 views3 pages

Document Summary

Branching directs a program to execute either one statement group or another if (expression) { // statements to execute when the expression is true (first branch) else { // statements to execute when the expression is false (second branch) Braces { }, represent a grouping, such as a grouping of statements. An if-else expression commonly involves a relational operator or equality operator: a < b; a > b; a <= b; a >= b; a == b; a != b; The operation evaluates to a boolean value meaning either true or false. The relational and equality operators work for integer, character, and floating-point built-in types: the operators should not be used with strings. Only 1 branch will execute if (expr1) { else if (expr2) { else if (exprn) { else { Programmers commonly use the sequential nature of the multi-branch if-else arrangement to detect ranges of numbers.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents