QUIZ ON OPERATORS & CONTROL STATEMENTS

QUIZ ON OPERATORS & CONTROL STATEMENTS

University

10 Qs

quiz-placeholder

Similar activities

Passaggio parametri

Passaggio parametri

University

9 Qs

Quiz on Java Operators

Quiz on Java Operators

University

7 Qs

Third Year Placement Training Revision Test

Third Year Placement Training Revision Test

University

10 Qs

Java Control Flow statements

Java Control Flow statements

University

10 Qs

javaquizvivek

javaquizvivek

University

12 Qs

OOP - Java Classes

OOP - Java Classes

12th Grade - University

15 Qs

Java Arrays

Java Arrays

University

10 Qs

Latihan1

Latihan1

University

10 Qs

QUIZ ON OPERATORS & CONTROL STATEMENTS

QUIZ ON OPERATORS & CONTROL STATEMENTS

Assessment

Quiz

Computers

University

Easy

Created by

Renugadevi Professor

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?

a) do-while


b) while

c) for

d) none of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class selection_statements

  2. {

  3. public static void main(String args[])

  4. {

  5. int var1 = 5;

  6. int var2 = 6;

  7. if ((var2 = 1) == var1)

  8. System.out.print(var2);

  9. else

  10. System.out.print(++var2);

  11. }

  12. }

1

2

3

4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

. What will be the output of the following Java program?

  1. class comma_operator

  2. {

  3. public static void main(String args[])

  4. {

  5. int sum = 0;

  6. for (int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1)

  7. sum += i;

  8. System.out.println(sum);

  9. }

  10. }

5

6

14

compialtion error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class Output

  2. {

  3. public static void main(String args[])

  4. {

  5. final int a=10,b=20;

  6. while(a<b)

  7. {

  8.  

  9. System.out.println("Hello");

  10. }

  11. System.out.println("World");

  12.  

  13. }

  14. }

Hello

run time error

Hello world

compile time error

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What would be the output of the following code snippet if variable a=10?

  1. if(a<=0)

  2. {

  3. if(a==0)

  4. {

  5. System.out.println("1 ");

  6. }

  7. else

  8. {

  9. System.out.println("2 ");

  10. }

  11. }

  12. System.out.println("3 ");

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is returned by “greater than”, “less than” and “equal to” operators?

Integers

Floating – point numbers

Boolean

None of the mentioned

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these operators can skip evaluating right hand operand?
a) !



a) !

b) |

c) &

d) &&

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?