CS 107 Lecture Notes - Lecture 6: Real Number

29 views3 pages
6 Oct 2016
School
Course
Professor

Document Summary

*if condition is true print brace block, if not, skip and continue with rest of program. If true do block 1, otherwise do block 2 int n=10; Else if (age ==0) (==) means comparison. Else if (age==1 | | age==2) (| |) means or. Only put it if you want something to happen when all the conditions are false. A truth hunt, followed by a get the heck out of there . Go down the list of conditions, hunting for truth. As soon as you hit a true condition, do only that block of code, and then get the heck out of there by exiting that if structure, and then continue with the rest of the program code. *if a braced block of code has only a single command/statement, then the braces are optional. But lots of programmers always put the braces regardless.

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