1. Trang chủ
  2. » Công Nghệ Thông Tin

BÀI GIẢNG NHẬP môn lập TRÌNH câu LỆNH điều KHIỂN và câu LỆNH rẽ NHÁNH

32 340 0
Tài liệu được quét OCR, nội dung có thể không chính xác

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 32
Dung lượng 2,01 MB

Nội dung

Trang 1

Generated by Foxit PDF Creator © Foxit Software httpy/www.foxitsoftware.com For evaluation only Trường Đại học Khoa học Tự nhiên

Khoa Công nghệ thông tin

Bộ môn Tin học cơ sở

NHẬP MƠN LẬP TRÌNH Đặng Bình Phương

dbphuong@fit.hcmus.edu.vn

Trang 4

Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only

| @ Câu lệnh if (thiếu)

-void main () |

Thuvientailieu.net.vn

Trang 8

com For evaluation only

Generated by Foxit PDF Creator © Foxit Software http:/Avww.foxitsoftware Nv’ t số lưu ý h if - Mộ ện au 7 so & B Ke

h if có thể lồng vào nhau và else sẽ

Trang 10

.ˆ ' ' tu “hy Seeeneeeeees

Trang 11

Generated by Foxit PDF Creator © Foxit Software httpy/www.foxitsoftware.com For evaluation only

Trang 12

xn#n SSHRC CSS H ESR SESH Eee ESSERE eee

Trang 13

by Foxit PDF Creator © Foxit Software Generated

httpy/www.foxitsoftware.com For evaluation only

Trang 15

Generated by Foxit PDF Creator © Foxit Software httpy/www.foxitsoftware.com For evaluation only

Ke Câu lệnh switch - Một số lưu ý 5» Câu lệnh switch là một câu lệnh đơn và có thể lồng nhau |+ switch (a)

{ case 1 : printf (“Mot”); break;

_ case 3: printf£("Ba”); break;

default : printf(“Khong biet doc”) ;

Trang 16

Generated by Foxit PDF Creator © Foxit Software

Trang 17

Generated by Foxit PDF Creator © Foxit Software TH khiiivee son For evaluation only

Câu lệnh switch - Một số lưu ý

3 switch sẽ nhảy đến case tương ứng và thực

Trang 18

s* switch nhảy đến case tương ứng và thực hiện

đến khi nào gặp break hoặc cuối switch sẽ kết

thúc

Thuvientailieu.net.vn

Trang 20

&

Generated by Foxit PDF Creator © Foxit Software

Trang 22

Generated by Foxit PDF Creator © Foxit Software

Tin Tưng sơn For evaluation only

Câu lệnh điều kiện và rẽ nhánh

Thuvientailieu.net.vn

Trang 23

Generated ftp evr SSetsltare.com" Por eveluon ony POF Creator' Software

Trang 24

Generated by Foxit PDF Creator © Foxit Software

fevers er ff For evaluation only

Thuvientailieu-net.vn

Trang 28

Generated by Foxit PDF Creator © Foxit Software

http:/Awww.foxitsoftware.com For evaluation only #include <stdio.h> #include <conio.h> void main() { ivit':.a, b; printf (“Nhap a, b: ”); scanf (“%d%d”, &a, &b); if (a == 0) if (b == 0) printf (“Phuong trinh VSN”) ; else printf (“Phuong trinh VN”) ; else

printf (“Nghiem = %f”, float (-b) /a)izs ee

Câu lệnh điều kiện và rẽ nhánh ` ee

Thuvientailieu-net.vn

Trang 29

#include <stdio.h> void main() { int .a, b, cy

print£ (“Nhap: a, b; oe: ”) 7

Trang 30

#include <stdio.h> |

void main () |

—_nnnne=

(V422 2t ty xe t = BESS eee e setae eeeeeee

SHCEC SSS SELES SSeS pane Ee

Ngày đăng: 15/08/2016, 12:12

TỪ KHÓA LIÊN QUAN