Page 1 of 1

11. The following incorrect "if" statement is (). (A) if (i>1); printf("%d\n",i); (B) if (x <0) x+=y; (C) if (x != y) x+

Posted: Wed Apr 27, 2022 3:34 pm
by answerhappygod
11 The Following Incorrect If Statement Is A If I 1 Printf D N I B If X 0 X Y C If X Y X 1
11 The Following Incorrect If Statement Is A If I 1 Printf D N I B If X 0 X Y C If X Y X 1 (73.73 KiB) Viewed 42 times
11. The following incorrect "if" statement is (). (A) if (i>1); printf("%d\n",i); (B) if (x <0) x+=y; (C) if (x != y) x++; else printf("%d", y); (D) if (x || !y) {x = y++;} 12. The result of the following program segment is (). int a = 100, x = 10, y = 20; if (x <y) if (y != 20) a = 1; else a = 10; printf("%d\n", a); (A) 100 (B) 1 (C) 10 (D) unconfirmed 13. The result of the following program segment is (. int x = 5; if (x> 5) printf("%d", --x); else printf("%d", x++); (A) 4 (B) 5 (C) 6 (D) 7 14. The number of executions of the loop body in the following program is int i, j; for (i=5; i>=0; --i) for(j=-6; j!=0; ++j) (A) 36 (B) 30 (C) 25 (D) 5 15. For the following program segment, the description() is correct. for(i=81; i>0; --i) { scanf("%d",&x); if (x < 0) continue; printf("%d\n", i); } (A) when x<0, the whole loop ends. (B) when x>=0, nothing is output. (C) printf function never executes. (D) printf function only executes when user enters non-negative x