PU - Day 1 assessments - Sivaram's class

PU - Day 1 assessments - Sivaram's class

Professional Development

10 Qs

quiz-placeholder

Similar activities

LC - Quiz 3

LC - Quiz 3

Professional Development

10 Qs

C Structures

C Structures

Professional Development

10 Qs

Java_1

Java_1

Professional Development

7 Qs

Unit-1 Revision Quiz

Unit-1 Revision Quiz

Professional Development

15 Qs

PreTrainingJavaScript

PreTrainingJavaScript

Professional Development

9 Qs

PU Day 1 assessments - Srinivas's batch

PU Day 1 assessments - Srinivas's batch

Professional Development

10 Qs

Quiz 1 Internship

Quiz 1 Internship

Professional Development

15 Qs

quiz1 - day2

quiz1 - day2

Professional Development

10 Qs

PU - Day 1 assessments - Sivaram's class

PU - Day 1 assessments - Sivaram's class

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

training atomm

Used 1+ times

FREE Resource

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. }

2
6
1
5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class test_output

  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. }

20

-10

30

10

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class comparison_test

  2. {

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

  4. {

  5. int x = 15;

  6. int y = 10;

  7. if (x != y)

  8. System.out.print(x);

  9. else

  10. System.out.print(y);

  11. }

  12. }

0

10

15

20

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class increment_test

  2. {

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

  4. {

  5. int count = 5;

  6. if (++count > 5)

  7. System.out.print(count);

  8. else

  9. System.out.print(count - 1);

  10. }

  11. }

7

4

6

5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class logical_test

  2. {

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

  4. {

  5. boolean a = true;

  6. boolean b = false;

  7. if (a && b)

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

  9. else

  10. System.out.print("False");

  11. }

  12. }

Exception

Null

False

True

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class ternary_test

  2. {

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

  4. {

  5. int num = 8;

  6. String result = (num % 2 == 0) ? "Even" : "Odd";

  7. System.out.print(result);

  8. }

  9. }

Even

Odd

Null

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class switch_case_test

  2. {

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

  4. {

  5. int day = 3;

  6. switch (day)

  7. {

  8. case 1:

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

  10. break;

  11. case 2:

  12. System.out.print("Tuesday");

  13. break;

  14. case 3:

  15. System.out.print("Wednesday");

  16. break;

  17. default:

  18. System.out.print("Invalid day");

  19. }

  20. }

Tuesday

Monday

Wednesday

Invalid day

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?