2 - University of Florida



1. Lines beginning with the _______________ let the computer know that the rest of the line is a comment.

(a) /*

(b) **

(c) REM

(d)

(d) >=

ANS: (a)

19. The compile stage is when ____________.

(a) the object code is linked with code for functions in other files

(b) the C program is translated into machine language code

(c) the program is executed one instruction at a time

(d) the program is placed in memory

ANS: (b)

20. If x = 3, which of the following sets x to 7?

(a) x *= 4;

(b) x += 4;

(c) x =+ 4;

(d) x + 4 = x;

ANS: (b)

21. Which assignment expression is equivalent to c = c / 2 ?

a) c /= 2c

b) c / c = 2

c) c /= 2

d) c =/ 2

ANS: (c)

22. Which of the following will not increment variable c by one?

(a) c + 1;

(b) c++;

(c) ++c;

(d) c += 1;

ANS: (a)

23. An example of a unary operator is

(a) a relational operator

(b) an assignment operator

(c) an increment operator

(d) a logical operator

ANS: (c)

24. Consider the following code, what is the output?

int x=12;

printf(“%d”, x);

(a) 6

(b) 12

(c) nothing

(d) a syntax error is produced

ANS: (b)

25. Of the following, which is an error?

(a) putting a space between float and the variable name

(b) dividing by zero

(c) initialize counter to one by using int counter = 1;

(d) no semicolon after #include

ANS: (b)

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download