Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 18 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
18
Dung lượng
235 KB
Nội dung
C++ Programming Lecture Control Structure I (Selection) – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides) Outline Introduction if statement if/else statement Nested if/else statements Examples The Hashemite University Control Structures Sequential execution Transfer of control Statements executed one after the other in the order written When the next statement executed is not the next one in sequence All programs written in terms of control structures: Sequence structure Selection structures Built into C++ Programs executed sequentially by default C++ has three types - if, if/else, and switch Repetition structures C++ has three types - while, do/while, and for The Hashemite University Control structure example Sequence structure int main() { i cout