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

16-17,HK2_IntroductionC(CLC)Mau 3 (Solution)

6 9 0

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

THÔNG TIN TÀI LIỆU

HCMC University of Technology and Education Solution (Final exam at Faculty for High Quality Training the end of the semester 2, 2016-2017) ECET Supervisor Signature Subject: Introduction to C programming language Supervisor Signature Subject code: CPRL130064E Number of pages: 06 pages Duration: 75 minutes Points and Signatures Used paper documents Students work directly on the exam and submit all The first marking The second marking lecture lecture First and last name: Student ID: Order number: Room: Question 1: (2.0 points) Give a following program, please perform: a) b) Draw a flowchart? (1 point) Show results on the screen after performing the program? (1 point) # #include I t main(void) { int a = 12, b = 6, c = 17, d; if ((a >= b) || (b= b) || (b0; i) printf("%d \t", i); } a) Results on the screen: 15 14 13 12 11 10 printf("%d \t", i); while ( i > 0); } b) Pseudocode: Set i to 15 While i is larger than Print i on the screen Decrease i by Question 3: (1.0 points) What does the following program print? #include int main (void) { unsigned int row = 4; // initialize row unsigned int column; // define column while (row >= 1) // loop until row < { column = 1; // set column to as iteration begins while (column 38.5) { printf("%d\n", p[i].NodeID); puts(p[i].NodeName); printf("%f\n", p[i].Temp); } //0.25 getch(); } Notation: Supervisor officials are not allowed to explain the exam questions Expected Learning Outcomes (About knowledge) Test contents [ELO 1.1]: Draw a flowchart, Pseudocode Questions 1, [ELO 1.3]: Demonstrate command syntax, operation and application of branching and iteration structures in C language Questions 1, 2, [ELO 1.5]: Present how the pointer is declared and how to use the pointer to retrieve the memory Questions 4, [ELO 1.6]: Use function in a program Question [ELO 1.7]: Define structure type and use structure variables to store and manage data Question [ELO 2.1]: Analyze the programming requirements from which to build a flowchart, a complete program Questions 1, 2, [ELO 3.1]: Apply control structures, apply data manipulation, build support functions to design and solve application programming requirements Questions 2, June 12th, 2017 Head of ECET ... void main() { int a[6] = { 1, 2, 3, 4, 5, 6}; int *p1 = &a[1]; int *p2 = &a [3] ; *p1 = *p2 + 4; *(p1 - 1) = *p2 - 5; *(p2 + 1) = a[2] + a [3] ; *(p2 + 2) = *(p1 - 1) + *p1; printf("%d... > 38 .5) dem++; printf(" %d Nodes with high temperature ( >38 .5) ", dem); //0.25 printf("Information of those Nodes with high temperature: "); for (i = 0; i < 10; i++) if (p[i].Temp > 38 .5)... greater than 38 .5 Print all information of these Sensor Nodes on the screens #include "stdafx.h" #include #include struct SensorNode { int NodeID; char NodeName [32 ]; float Temp;

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

Xem thêm: