Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture Introduction to Computer Programming - Lecture 9
tailieunhanh - Lecture Introduction to Computer Programming - Lecture 9
The contents of this chapter include all of the following: Nested if else statement, logical operator in C, how logical operator can be used to make compound conditions, conditional operator, nested conditional operator, nested if-else, nested conditional operator, loops. | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 9 Thanks to Detal and Detal official website for some lecture slides Switch Statement continued from the last Lecture Decisions Using switch The control statement that allows us to make a decision from the number of choices is called a switch, or Switch is also called a switch-case-default, since these three keywords go together to make up the control statement 5/26/2012 3 Switch --- Features The integer expression following the keyword switch could be: an integer constant like 1, 2 or 3, or a character constant like ‘a’ or an expression that evaluates to an integer like 2*4 The constant in each case must be different from all the others. The “do this” lines in the body of switch construct represent any valid C statements 5/26/2012 4 Switch --- General Format switch ( integer expression ) { case constant 1 : do this ; case constant 2 : do this ; case constant 3 : do this ; default : do this ; } 5/26/2012 5 Switch statement ---- incorrect void main( ) { int i = 2 ; switch ( i ) { case 1 : printf ( "I am in case 1 \n" ) ; case 2 : printf ( "I am in case 2 \n" ) ; case 3 : printf ( "I am in case 3 \n" ) ; default : printf ( "I am in default \n" ) ; } /* What is the out put? */ } 5/26/2012 6 Switch statement ---- incorrect output I am in case 2 I am in case 3 I am in default Why ? Correct program would be 5/26/2012 7 5/26/2012 8 void main( ) { int i = 2 ; switch ( i ) { case 1 : printf ( "I am in case 1 \n" ) ; break ; case 2 : printf ( "I am in case 2 \n" ) ; break ; case 3 : printf ( "I am in case 3 \n" ) ; break ; default : printf ( "I am in default \n" ) ; } } Switch statement ---- correct Output: I am in case 2 5/26/2012 9 void main( ) { int i = 22 ; switch ( i ) { case 121 : printf ( "I am in case 121 \n" ) ; break ; case 7 : printf ( "I am in case 7 \n" ) ; break ; case 22 : printf ( "I am in case 22 \n" ) ; . | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 9 Thanks to Detal and Detal official website for some lecture slides Switch Statement continued from the last Lecture Decisions Using switch The control statement that allows us to make a decision from the number of choices is called a switch, or Switch is also called a switch-case-default, since these three keywords go together to make up the control statement 5/26/2012 3 Switch --- Features The integer expression following the keyword switch could be: an integer constant like 1, 2 or 3, or a character constant like ‘a’ or an expression that evaluates to an integer like 2*4 The constant in each case must be different from all the others. The “do this” lines in the body of switch construct represent any valid C statements 5/26/2012 4 Switch --- General Format switch ( integer expression ) { case constant 1 : do this ; case constant 2
Khánh Thủy
74
1
pptx
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Bấm vào đây để xem trước nội dung
Tải xuống
TÀI LIỆU LIÊN QUAN
Pro PHP and iQuery
401
104
0
Principles of Programming Languages
166
128
0
Lecture Programming languages (2/e): Chapter 12b - Tucker, Noonan
14
98
0
Discovering Computers - Chapter 13: Programming Languages and Program Development
51
100
0
Beginning Algorithms
591
111
0
PHP Game Programming
377
114
0
LAND OF LISP
508
81
0
Lecture Programming languages (2/e): Chapter 14a - Tucker, Noonan
18
86
0
Lecture Programming languages (2/e): Chapter 15a - Tucker, Noonan
20
86
0
Lecture Programming languages (2/e): Chapter 12d - Tucker, Noonan
38
92
0
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461871
55
Giới thiệu :Lập trình mã nguồn mở
14
22685
61
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10901
530
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10072
446
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9535
104
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8294
1125
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8244
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7866
2220
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6696
253
Vật lý hạt cơ bản (1)
29
5777
85
TỪ KHÓA LIÊN QUAN
Kỹ thuật lập trình
Programming languages
Computing systems
C programming language
Introduction to computer
Operating system software
Introduction to computer
experience in programming
software engineering
programming languages
computer programming
programming tips
programming experience
code programming
design tips
programming documentation
programming skills
the Ruby programming document
methods Ruby programming language
Lecture Programming languages
Ngôn ngữ lập trình
Imperative programming
Imperative languages
Dynamic allocation
Discovering Computers
Program Development
Low Level Languages
Procedural Languages
Object Oriented Programming Languages
java programming language C + +
C programming
computer software
computer engineering
computer programming language PHP
Functional programming
Functional programming models
Lambda calculus
Logic programming
Logic programming in prolog
Prolog program elements
Scripting languages
Lecture Introduction to computing
Bài giảng Nhập môn máy tính
Introduction to computing
Role of programming languages
Android Programming
Java
programming code
Procedural abstraction
Data structures
Matrix multiplication
Object oriented programming
Abstract data types
The object model
Object oriented language
Represent polynomials
Symbolic differentiation
Mixed language
Scripting language
Semantics of clite
List comprehensions
Practical aspects of prolog
Natural language processing
Event driven programming
Event driven control
Event handling
Java applet
Tic Tac Toe
TÀI LIỆU MỚI ĐĂNG
Đánh giá hao mòn và độ tin cậy của chi tiết và kết cấu trên đầu máy diezel part 3
12
314
0
29-04-2024
Báo cáo khoa học: Loss of kinase activity in Mycobacterium tuberculosis multidomain protein Rv1364c
14
235
0
29-04-2024
CẤU TẠO HẠT NHÂN NGUYÊN TỬ-ĐỘ HỤT KHỐI-NĂNG LƯỢNG LIÊN KẾT-LK RIÊNG
12
268
0
29-04-2024
Bơm máy nén quạt trong công nghiệp part 8
20
198
2
29-04-2024
báo cáo hóa học:" Journal of the International AIDS Society: an important step forward"
2
86
0
29-04-2024
Thương hiệu sản phẩm làng nghề: Đã ít, lại thiếu tính cạnh tranh
5
117
0
29-04-2024
Tự học thổi sáo và ngâm thơ part 4
11
150
1
29-04-2024
Norton ghost : Chương trình sao chép ổ cứng part 9
8
102
0
29-04-2024
The Constituents of Medicinal Plants
185
99
0
29-04-2024
CHƯƠNG 2: RỦI RO THÂM HỤT TÀI KHÓA
28
112
0
29-04-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7866
2220
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5760
1382
Ebook Chào con ba mẹ đã sẵn sàng
112
3770
1232
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5328
1136
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8294
1125
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3504
643
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10901
530
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3689
525
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4060
516
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4133
480
crossorigin="anonymous">
Đã 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.