MECH 215 Lecture Notes - Lecture 3: Switch Statement, Operand, Bit Field

79 views42 pages

Document Summary

Up to now, all of the programs we have seen were examples of what is known as straightline programming. Program execution commenced with the first statement and proceeded statement by statement until the end of the program was reached. Most non-trivial programs require some sort of mechanism to alter the sequence of statement execution. C++ has two conditional constructs and three looping constructs. The conditional constructs determine which statements are to be executed depending upon a certain condition, the looping contructs determine the number of times a block of statements is to be executed. In the original version of the c programming language a. Logical false was represented by the integer value 0, a logical true was represented by any non-zero integer. Thus in c (and early versions of c++) the following were all legal ways of representing a logical true: Similarly, the following are legal ways of expressing a logical false.

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