Electronics and Communication Engineering - Microprocessors

16.
Assuming that k is an integer what would the result of following expression in C
k = 2* 3 / 5 + 4 / 4 + 8 - 2 - 4 / 8
8
7
7.5
zero
Answer: Option
Explanation:

k = 1 + 1 + 8 - 2 - 0 = 8 because k is an integer.


17.
Which of the following is a valid real constant?
1281
1281.0
KM
11821
Answer: Option
Explanation:

It is the only one with decimal point.


18.
Which of the following is a valid real constant?
-81.56
73
10254,1
42
Answer: Option
Explanation:

It is the only one with decimal and without comma.


19.
Consider the following program in C

int k
float b ;
k = 3
b = 10.1
k = k / b


The final result would be k =
0.297
0.2
0
3
Answer: Option
Explanation:

Since K is int hence answer is 0.


20.
The decimal equivalent of binary 1101.11 is
9.75
13.75
11.50
11.75
Answer: Option
Explanation:

Convert to decimal.