Electronics and Communication Engineering - Microprocessors - Discussion

Discussion Forum : Microprocessors - Section 2 (Q.No. 10)
10.
Which of the following operations will give the result 2 in C?
5 / 2
4.0 / 2
4.0 / 2.0
4 / 2.0
Answer: Option
Explanation:

Since both 5 and 2 are integers, the result will be 2.

Discussion:
3 comments Page 1 of 1.

Gaurav said:   8 years ago
How it will be option A?

Akash said:   7 years ago
Please explain the answer.

Vennela said:   6 years ago
In division c takes quotient as a result. Here both 5 and 2 are integers so output can be taken as 2 (integer), but in other options contain floating points so output can be a float.

Post your comments here:

Your comments will be displayed after verification.