Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. What is the output of the following code? int a = 15 ; int b = 6 , c; a = b++ + 3

1. What is the output of the following code? int a = 15 ; int b = 6 , c; a = b++ + 3 ; c = a / 3 + b; System.out.println(a + + b + + c);

2. What is the output of the following code? int a = 10, y = 5, x; a *= 2; x = a-- + 7 / 3 * 6 % y; System.out.println(a + + x);

3. What is the value of x after executing the following Java statement? int x = 10 % 3 + 5 / 2;

4. What is the output of the following Java code? int x = 5 ; int y = 3 , z; x = 10 + --y ; z = x % 5 / 6 + y; System.out.println(x + + y + z);

5. What will be the value of y after executing the following code? int w = 4; double y; w -= 2; y = 3 + 10 % 3 * 5 / w;

6. What is the output of the following Java code? int x = 5 ; int y = 3 , z; x = 10 + --y ; z = x % 5 / 6 + y; System.out.println("X=" + x + " Y= " + y + "Z=" + z);

7. What would be printed after executing the following code? int a, u=10, v=8; double z = 2.5; u = u int( 2 + v * z); a = u + v - z; System.out.println (a + + (u + v -z ));

9. Suppose that the input is 0. What is output of the following code? int angle; Scanner input= new Scanner(System.in); Angle = input.nextInt(); if (angle > 5) angle = angle + 5; else if (angle > 2) angle = angle + 10; System.out.println(angle);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions