Bit_Masking

Bit_Masking

University

10 Qs

quiz-placeholder

Similar activities

Java Programming

Java Programming

University

15 Qs

JAVA array

JAVA array

12th Grade - University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

Milking Minds 2 17-01-24

Milking Minds 2 17-01-24

University

15 Qs

OOP - Java Classes

OOP - Java Classes

12th Grade - University

15 Qs

Quiz 8: Arrays&Vector

Quiz 8: Arrays&Vector

University

10 Qs

JAVA - Arrays

JAVA - Arrays

University - Professional Development

15 Qs

Java Quiz 3

Java Quiz 3

University

15 Qs

Bit_Masking

Bit_Masking

Assessment

Quiz

Computers

University

Hard

Created by

Kirti Aggarwal

Used 5+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following expression do?

x = (x<<1) + x + (x>>1);

multiplies an integer with 7

multiplies an integer with 3.5

multiplies an integer with 3

multiplies an integer with 8

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose we have a set {1,  2, 3}. Find the XOR of all the subsets of the set.

1

2

3

0

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Right shift(>>) and Left shift(<<) are equivalent to _____ by 2.

multiply and divide

divide and multiply

addition and subtraction

subtraction and addition

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If we want to invert all the bits of a number, then which bitwise operator should be used?

~

&

|

^

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following expression? (num ^ 0)

it will print 0

it will print num

it will print 1

none

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is not a bitwise operator?

&

&=

|=

<=

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public static void main(String[] args) {

byte z = 16;

int x;

x = z << 3;

System.out.println("Value of z= " + z);

System.out.println("Value of x= " + x);

}

Value of z= 16

Value of x= 128

Value of z= 16

Value of x= 2

Value of z= 1

Value of x= 128

Value of z= 1

Value of x= 2

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?