Vidyalelo
Java Programming · Q16

Operators

Programming · Java Programming · question 16

Q16

What is the result of the expression 4 * 2 + 3 in Java?

A.
14
B.
20
C.
11
Answer
D.
10

Answer: Option C

Solution

Answer: Option C
Solution:
Let's break down this Java expression step-by-step:

The expression is: 4 * 2 + 3

Java follows the order of operations (PEMDAS/BODMAS):
   1. Parentheses / Brackets
   2. Exponents / Orders
   3. Multiplication and Division (from left to right)
   4. Addition and Subtraction (from left to right)

In our expression, we have multiplication and addition. Multiplication comes first:
   4 * 2 = 8

Now we have: 8 + 3

Next, we do the addition:
   8 + 3 = 11

Therefore, the result of the expression 4 * 2 + 3 in Java is 11.

So, the correct answer is: Option C: 11