Basic Data Structures – Exercise – 1

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
(c) assigns a value 18 to i 
(d) assigns a value 19 to i

Answer
Answer : (a)
Explanation
Explanation : No answer description available for this question. Let us discuss.
Discuss
Discuss : Write your answer. Click here.

7. Literal means :

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

Answer
Answer : (b)
Explanation
Explanation : No answer description available for this question. Let us discuss.
Discuss
Discuss : Write your answer. Click here.

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
Answer : (b)
Explanation
Explanation : No answer description available for this question. Let us discuss.
Discuss
Discuss : Write your answer. Click here.

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

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

Answer
Answer : (d)
Explanation
Explanation : No answer description available for this question. Let us discuss.
Discuss
Discuss : Write your answer. Click here.

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
Answer : (a)
Explanation
Explanation : No answer description available for this question. Let us discuss.
Discuss
Discuss : Write your answer. Click here.

Related Posts

  • Basic Data Structures – 2Basic Data Structures » Exercise - 12. A global variable is a variable : (a) declared in the main ( ) function. (b) declared in any function other than the main ( ) function. (c) declared outside the body of every function. (d) declared any where in the C program.
    Tags: function, declared, basic, data, structures, variable, main, exercise, computer, science
  • Basic Data Structures – 1Basic Data Structures » Exercise - 1 1. main ( ) is an example of : (a) header (b) statement (c) library function (d) user defined function 
    Tags: basic, data, structures, function, exercise, main, statement, computer, science
  • Basic Data Structures – 4Basic Data Structures » Exercise - 14. The first digit of a decimal constant must be : (a) a zero (b) a non zero number (c) a negative number (d) an integer
    Tags: basic, data, structures, number, exercise, constant, integer, computer, science
  • Basic Data Structures – 7Basic Data Structures » Exercise - 17. Literal means : (a) a string (b) a string constant (c) a character (d) an alphabet
    Tags: basic, data, structures, string, exercise, constant, character, computer, science
  • Basic Data Structures – 3Basic Data Structures » Exercise - 13. While incrementing a pointer, its value gets increased by the length of the data type to which it points. This length is called : (a) scale factor (b) length factor (c) pointer factor (d) increment factor
    Tags: factor, data, length, basic, structures, pointer, exercise, computer, science