ENGM 1081 Lecture Notes - Lecture 6: Semicolon, Or Gate, And Gate

29 views3 pages
Verified Note

Document Summary

Engm1081- lecture 6 conditional and if else statement. In such a case we use the following conditional statements to out advantage: General case: if(conditional_statement_is_true){ indent with 1 tab here perform commands written here each of these commands have a semi-colon ";" True and false are associated with boolean algebra. Where true represents a 1 and false represents a 0. Example: consider a scenario where x=4 if(x > 3) would return a 1 if(x >= 50. 44) would return a 0. A set of commands occur if the conditional argument receives a value of 1, the commands in the final else automatically execute if the final else has been reached as it represents the only possible scenario left. For multiple associated if"s if(conditional_statement_is_true){ check condition 1. If true, perform commands written here and so on. }else{ when all the above if"s turn out to be false perform commands written here.

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