This topic contains a solution. Click here to go to the answer

Author Question: Analyze the following code: int x = 0; int y = ((x < 100) && (x > 0)) ? 1: -1; (Read 37 times)

fbq8i

  • Hero Member
  • *****
  • Posts: 527

Question 1

What is y after the following switch statement?

int x = 0;
int y = 0;
switch (x + 1) {
case 0: y = 0;
case 1: y = 1;
default: y = -1
}

◦ 0
◦ 1
◦ 2
◦ -1

Question 2

Analyze the following code:

int x = 0;
int y = ((x < 100) && (x > 0)) ? 1: -1;

◦ y becomes 1 after the code is executed.
◦ y becomes -1 after the code is executed.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by fbq8i on May 6, 2020

mtmmmmmk

  • Sr. Member
  • ****
  • Posts: 335
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 25% of students answer this correctly




fbq8i

  • Member
  • Posts: 527
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


recede

  • Member
  • Posts: 315
Reply 3 on: Yesterday
Gracias!

 

Did you know?

Today, nearly 8 out of 10 pregnant women living with HIV (about 1.1 million), receive antiretrovirals.

Did you know?

Each year in the United States, there are approximately six million pregnancies. This means that at any one time, about 4% of women in the United States are pregnant.

Did you know?

Fewer than 10% of babies are born on their exact due dates, 50% are born within 1 week of the due date, and 90% are born within 2 weeks of the date.

Did you know?

Always store hazardous household chemicals in their original containers out of reach of children. These include bleach, paint, strippers and products containing turpentine, garden chemicals, oven cleaners, fondue fuels, nail polish, and nail polish remover.

Did you know?

In Eastern Europe and Russia, interferon is administered intranasally in varied doses for the common cold and influenza. It is claimed that this treatment can lower the risk of infection by as much as 60–70%.

For a complete list of videos, visit our video library