Question 4 (15 marks) a) Write the output when the following code segments in program 1.1 (Figure 6). program 1.2 (Figure 7) and program 3 (Figure 8) are executed //program 1.1 int a-l, b2, -3; printf("d",c! (a>b) (bcc): Figure 6 Answer: (5.murks) //program 1.2 int a -5, b-10, c-11; x-ab/--c+5; printf("\n",-,x): printzid d\n", C, Y) Figure 7 Answer: (marks)
1/program 1.2 int a =5, b=10, c=11; x= a*b/--c+5; printf("dd\n", --c, x); y = 3. C++ >= a; printf(ad d\n", c, y): Figure 7 Answer: (5 marks) 1/program 1.3 int num-6234; float weight - 72.658; int abc = 65: // ASCII code 65 - X printf ("6d\n", num. 2): printf (13d\n", num - 2000): printf ("#4.2f\n", weight - 1.1); printf ("\n", 987.65 +2.1234); printf ("cic icin", abc, abc + 1. abc + 2): printf ("1 to $X\n", abe + 1, abc . 2, abc + 3); printf("I like my is dla", abe, 1953 + abe); Figure 8 Answer: (5 marks)
没有找到相关结果