TAILIEUCHUNG - Lecture Practical C++ programming - Chapter 6: Decision and control statements

Student are now introduced to the fact that computers cannot only do computitions, but can also make decisions. Decision statements for the most part are fairly straight-forward and fairly simple, as are the relation operators. A conditional statement works on the single statement that follows it. This chapter will introduce "Decision and control statements" in C, inviting you refer. | Chapter - 6 Decision and Control Statements Practical C Programming Copyright 2003 O Reilly and Associates Page1 What are decision and control statements We ve been working on linear programs. That is we start the program and execute each s tatement in a straight line until we reach the end. Decision and control statements allow us to change the flow of the program. Branching statements cause one section of code to be executed or not depending on a conditional clause. Looping statements allow a section of code to be repeated a number of times or until a condition occurs. Practical C Programming Copyright 2003 O Reilly and Associates Page2 if Statement General form if condition statement If the condition is true non-zero the statement is executed. If the condition is false zero the statement is not executed. Example if total_owed 0 std cout You owe nothing. n Practical C Programming Copyright 2003 O Reilly and Associates .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.