CS136 Lecture Notes - Lecture 6: Imperative Programming, Infinite Loop, Sizeof

26 views5 pages

Document Summary

Input formatting: when c reads in int values, it skips over any whitespaces includes. Reading input: cannot be re-read, the value is lost after read, typically want to store the read value in a variable, in order to refer to it multiple times. Control flow: use to model how programs are executed, always keep track of the program location (current executed line, when a program is run , the program location starts at the beginning of the main function. Types of control flow: function calls. When function is called, the program location jumps to the start of the function. Return control flow: return back the to location which the function is called, conditions (if statements) Syntax of if is: if (expression) statement. The statement is only executed if the expression is true. Only affects whether the next statement is executed. Can have a sequence of statement in place.

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