Search Header Logo

PU Day 1 assessments - Srinivas's batch

Authored by training atomm

Professional Development

Professional Development

Used 1+ times

PU Day 1 assessments - Srinivas's batch
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

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
6
5
2

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class TestOutput

  2. {

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

  4. {

  5. int a = 10;

  6. int b = 20;

  7. if (a < b)

  8. System.out.print(a + b);

  9. else

  10. System.out.print(a - b);

  11. }

  12. }

30

-10

10

20

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class CompareValues

  2. {

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

  4. {

  5. int x = 15;

  6. int y = 15;

  7. if (x == y)

  8. System.out.print("Equal");

  9. else

  10. System.out.print("Not Equal");

  11. }

  12. }

Equal

Error

Not Equal

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class LoopExample

  2. {

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

  4. {

  5. for (int i = 0; i < 3; i++)

  6. System.out.print(i);

  7. }

  8. }

  9. }

321

None

123

012

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will the following do-while loop execute?

int i = 1;

do {

System.out.println(i);

i++;

} while(i <= 5);

5
6
4
3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class StringComparison

  2. {

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

  4. {

  5. String str1 = "Hello";

  6. String str2 = "Hello";

  7. if (str1.equals(str2))

  8. System.out.print("Match");

  9. else

  10. System.out.print("No Match");

  11. }

  12. }

None of the above

Match

Error

No Match

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class ConditionalCheck

  2. {

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

  4. {

  5. int num = 8;

  6. if (num % 2 == 0)

  7. System.out.print("Even");

  8. else

  9. System.out.print("Odd");

  10. }

  11. }

Even

Odd

None of the above

Error

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Professional Development