Electronics and Communication Engineering - Microprocessors - Discussion
Discussion Forum : Microprocessors - Section 3 (Q.No. 16)
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
k = 2* 3 / 5 + 4 / 4 + 8 - 2 - 4 / 8
Answer: Option
Explanation:
k = 1 + 1 + 8 - 2 - 0 = 8 because k is an integer.
Discussion:
5 comments Page 1 of 1.
Kanchana said:
6 years ago
Yes.
Bodmas rule was applied.
2*3/5 ==> 6/5 = 1.2 = 1.
4/4==> 1.
+8
-2
4/8==> 0.5 = 0.
In the 1st step, 1.2 is treated as '1'.
And the last step 0.5treated as '0'.
Because k is an integer.
Bodmas rule was applied.
2*3/5 ==> 6/5 = 1.2 = 1.
4/4==> 1.
+8
-2
4/8==> 0.5 = 0.
In the 1st step, 1.2 is treated as '1'.
And the last step 0.5treated as '0'.
Because k is an integer.
(1)
Ravi Garg said:
9 years ago
Is Bodmas formula applied or not?
4/8 = 0?
4/8 = 0?
Akash said:
7 years ago
Why answer is 8? I don't understand.
Arthi said:
7 years ago
How 4/8=0?
Paras said:
6 years ago
BODMAS rule:
1. Brackets.
2. Orders.
3. Division AND multiplication (left to right).
4. Addition AND subtraction (left to right).
1. Brackets.
2. Orders.
3. Division AND multiplication (left to right).
4. Addition AND subtraction (left to right).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers