Question: Given the code segment below, indicate the output for the following initial values of (x) and (y) : A. What is the output if the

Given the code segment below, indicate the output for the following initial values of \(x\) and \(y\) :

int z = 0; if (x >= 100) if (y < 0)

A. What is the output if the integer variable \(x\) contains 10 and \(y\) contains -15 ?
B. What is the output if the integer variable \(\mathrm{x}\) contains 100 and \(\mathrm{y}\) contains 20 ?
C. What is the output if the integer variable \(x\) contains 200 and \(y\) contains -100 ?

int z = 0; if (x >= 100) if (y < 0) z = 25; else else z = 50; if (y < 0) z = 75; else z = 100; System.out.println (z);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the given code segment and the initial values of x and y provided lets determine the output ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!