Sunday, July 21, 2024

Arithematic operators MCQ

 Which symbol is used for addition in Java?

a) +

b) -

c) *

d) /


What does the modulus operator '%' return?

a) Quotient

b) Remainder

c) Multiplication

d) Exponentiation


Which operator is used for multiplication in Java?

a) *

b) %

c) ^

d) &


What is the result of the expression 15 / 2 in Java?

a) 7

b) 7.5

c) 8

d) 8.5


Which operator is used for subtraction in Java?

a) +

b) -

c) --

d) /


What is the result of the expression 7 % 3 in Java?

a) 1

b) 2

c) 3

d) 4


Which operator is used for division in Java?

a) /

b) //

c) ÷

d) ÷÷


If 'a' is 5 and 'b' is 3, what is the result of the expression 'a * b' in Java?

a) 15

b) 8

c) 53

d) 2


What does the exponentiation operator '**' do in Java?

a) Raises a number to the power of another number

b) Performs bitwise XOR

c) Calculates the square root

d) Multiplies two numbers


If 'x' is 10 and 'y' is 3, what is the result of the expression 'x / y' in Java?

a) 3.3333

b) 3

c) 3.0

d) 4


Answers:


a) +

b) Remainder

a) *

c) 8

b) -

a) 1

a) /

a) 15

a) Raises a number to the power of another number

c) 3.0

No comments:

Post a Comment

git commands MCQ

 Here are some multiple-choice questions (MCQs) on Git commands relevant for Selenium: 1. Which Git command is used to clone a remote reposi...