Question: Write an if-else statement that assigns 1 to x when y is equal to 100. Otherwise, it should assign 0 to x.

Write an if-else statement that assigns 1 to x when y is equal to 100. Otherwise, it should assign 0 to x.

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

x y 100 1 0 The ternary expression y 100 1 0 can be read as if y is equal to ... 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 Starting Out With Java From Control Structures Questions!