pulse Click on Answer tab for Answers.

Basic Data Structures – 1 – 2

6. If the variables i, j and k are assigned the values 5,3 and 2 respectively, then the expression

i = j + ( k + + = 6 ) + 7

(a) gives an error message
(b) assigns a value 16 to i
(b) assigns a value 18 to i
(d) assigns a value 19 to i 

ANSWER

EXPLANATION

7. Literal means :

(a) a string
(b) a string constant
(c) a character
(d) an alphabet

ANSWER

EXPLANATION

8. If an integer needs two bytes of storage, then the maximum value of a signed integer is :

(a) 216-1
(b) 215-1
(c) 216
(d) 215

ANSWER

EXPLANATION

9. A single character input from the keyboard can be obtained by using the function.

(a) printf ( )
(b) scanf ( )
(c) putchar ( )
(d) getchar ( )

ANSWER

EXPLANATION

10. In the following code fragment

int x, y = 2, z, a;
x=(y*=2) + (z=a=y);
printf (‘%d’,x);

(a) prints 8
(b) prints 6
(c) prints 6 or 8 depending on the compiler
(d) is syntactically wrong 

ANSWER

EXPLANATION

1 2

Share the Knowledge

Shares
Copy Protected by Chetan's WP-Copyprotect.