1. Trang chủ
  2. » Tất cả

16-17,HK2_Introduction C_QT1(English version)

2 4 0

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

THÔNG TIN TÀI LIỆU

Process examination (Semester 2nd 2016-2017) Course: Introduction to C programming language Duration time: 60 minutes (permitted documents) Question 1: (2 points): Show results on the screen after performing a following program: #include void main() { int c = 2; int a = -10; float b = 4.5; b += ++a / c; printf("%d %f ", a, b); } Question 3: (2 points) Read a following program: #include void main() { int a, b; scanf("%d%d", &a, &b); int kq = (a == b); switch (kq) { case 0: printf("different !"); break; default: printf("equal! "); } } Rewrite above program using if …else such that the program function is not changed Question (2 points): Write flowchart (1 point); and show results on the screen after performing a following program ( point): #include void main() { int a = 15, b = 5, c = 1; if (a > b) if (c > b) a = b + c; else b = ++a - c ; printf ("%d %d %d", a, b, c); } Question (2 points): Write Pseudocode (0.5 point); flowchart (0.5 point); and show results on the screen after performing a following program ( point): #include void main() { int i, a = 0; for (i = 1; i < 20; i++) if (i % != 0) a += i +1; else break; printf("%d %d", ++a, i ); } Question (2 points): Show results on the screen after performing a following program (0.5 point): #include void main() { int i = 0, a = 4; { a += i; i++; } while (i < && a < 13); printf("%d %d", a, i); } Rewrite the above program using: a) While (0.5 point); b) For (0.5 point) Draw flowcharts of 03 above programs (0.5 point) Số hiệu: BM3/QT-PĐBCL-RĐTV Trang: 1/8 Số hiệu: BM3/QT-PĐBCL-RĐTV Trang: 2/8

Ngày đăng: 16/06/2021, 18:16

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN