Q.1 Literal means
(A) a string. (B) a string constant.
(C) a character. (D) an alphabet.
Ans:B

Q.2 Choose the correct answer
(A) Casting refers to implicit type conversion.
(B) Coercion refers to implicit type conversion.
(C) Casting means coercion.
(D) Coercion refers to explicit type conversion.
Ans:B

Q.3 printf (“%d”, printf (“tim”));
(A) results in a syntax error (B) outputs tim3
(C) outputs garbage (D) outputs tim and terminates abruptly
Ans:B

printf statement will print tim3, “tim” due to inner printf statement and 3 as length due to
outer printf statement.


Q.4 Output of the following program fragment is
x = 5;
y = x++;
printf(“%d%d”, x, y);

(A) 5, 6 (B) 5, 5
(C) 6, 5 (D) 6, 6
Ans:C

x is incremented by 1 and before that increment the value is assigned to y so value of x=6 and
y=5.


Q.5 The value of an automatic variable that is declared but not initialised will be
(A) 0 (B) -1
(C) unpredictable (D) none of these
Ans:C

Q.6 Consider the following program
main ( )
{ float a = 0.5, b = 0.7;
if (b < 0.8)
if (a < 0.5) printf (“ABCD”);
else printf (“PQR”);
else printf (“JKLF);
}
The output is

(A) ABCD (B) PQR
(C) JKLF (D) None of these
Ans:B

Since b=0.7<0.8, the control goes to second “if” statement where (a<0.5) is false to printf
statement in else part executed printing “PQR”


Q.7 The following program fragment
int *a;
*a = 7;

(A) assigns 7 to a (B) results in compilation error
(C) assigns address of a as 7 (D) segmentation fault
Ans:D

Q.8 A pointer variable can be
(A) passed to a function as argument.
(B) changed within function.
(C) returned by a function.
(D) assigned an integer value.
Ans:C

Q.9 ‘C’ is often called a
(A) Object oriented language (B) High level language
(C) Assembly language (D) Machine level language
Ans:B

Q.10 The loop in which the statements within the loop are executed at least once is called
(A) do-while (B) while
(C) for (D) goto
Ans:A

Q.11 The control automatically passes to the first statement after the loop in
(A) continue statement (B) break statement
(C) switch statement (D) if statement
Ans:B

Q.12 A self contained block of statements that perform a coherent task of some kind is called a
(A) Monitor (B) Function
(C) Program (D) Structure
Ans:B

Q.13 Recursion is sometimes called
(A) Circular definition (B) Complex definition
(C) Procedure (D) Union
Ans:A

Q.14 Unsigned integer occupies
(A) Two bytes (B) Four bytes
(C) One byte (D) Eight bytes
Ans:B

Q.15 Each C preprocessor directive begins with
(A) # (B) include
(C) main() (D) {
Ans:A