Paper Tayyari

Lecture 4: Expressions and Operators

MCQs, short and long questions from lecture 4.Lecture 4 ki MCQs, short aur long sawal.

3 MCQs · 1 short question · 3 MCQs from past papers3 MCQs · 1 short sawal · 3 MCQs past papers se

Start mock testMock test shuru karein
DoneHal kiye 0/3
– correctsahi
1.
★ Past paper collection

What will be the result of arithmetic expression 6+48/4*3?

  1. A10
  2. B40.5
  3. C42
  4. D41

/ and * go left to right first: 48/4 = 12, 12*3 = 36, then 6 + 36 = 42.

2.
★ Past paper collection

In the given expression which operator will be evaluated first? 10 + (6 / 2) - 2 * 3?

  1. A+
  2. B-
  3. C/
  4. D*

The expression inside parentheses, 6 / 2, is evaluated first.

3.
★ Past paper collection

What will be the value of the variable output in the given piece of code? double output = 0; output = (2 + 2) * 4 + 2 / (4 - 2);

  1. A15
  2. B17
  3. C12
  4. D11

(2+2)*4 = 16 and 2/(4-2) = 1, so output is 17.