adplus-dvertising

Welcome to the Operators and Control Statements MCQs Page

Dive deep into the fascinating world of Operators and Control Statements with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Operators and Control Statements, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Operators and Control Statements, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Operators and Control Statements. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Operators and Control Statements. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Operators and Control Statements MCQs | Page 1 of 38

Q1.
Which of the following can be operands of arithmetic operators?
Discuss
Answer: (d).Both Numeric & Characters
Discuss
Answer: (c).Both Integers and floating – point numbers
Q3.
With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
1. x++;

2. x = x + 1;

3. x += 1;

4. x =+ 1;
Discuss
Answer: (c).1, 2, 3 & 4
Q4.
Decrement operator, −−, decreases the value of variable by what number?

a.

1

b.

2

c.

3

d.

4

Discuss
Answer: (a).1
Discuss
Answer: (d).None of the mentioned
Q6.
What is the output of this program?
    class increment 
    {
        public static void main(String args[])
        {
            double var1 = 1 + 5; 
            double var2 = var1 / 4;
            int var3 = 1 + 5;
            int var4 = var3 / 4;
            System.out.print(var2 + " " + var4);
 
        } 
    }
Discuss
Answer: (c).1.5 1
Q7.
What is the output of this program?
    class Modulus 
    {
        public static void main(String args[]) 
        {    
             double a = 25.64;
             int  b = 25;
             a = a % 10;
             b = b % 10;
             System.out.println(a + " "  + b);
        } 
    }
Discuss
Answer: (a).5.640000000000001 5
Q8.
Which of these is not a bitwise operator?
Discuss
Answer: (d).<=
Q9.
Which operator is used to invert all the digits in a binary representation of a number?
Discuss
Answer: (a).~
Q10.
On applying Left shift operator, <<, on integer bits are lost one they are shifted past which position bit?
Discuss
Answer: (d).31
Page 1 of 38

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!