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 32 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
Wow, this really help


tkempin

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

 

Did you know?

There are actually 60 minerals, 16 vitamins, 12 essential amino acids, and three essential fatty acids that your body needs every day.

Did you know?

Though newer “smart” infusion pumps are increasingly becoming more sophisticated, they cannot prevent all programming and administration errors. Health care professionals that use smart infusion pumps must still practice the rights of medication administration and have other professionals double-check all high-risk infusions.

Did you know?

It is difficult to obtain enough calcium without consuming milk or other dairy foods.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

Did you know?

Illicit drug use costs the United States approximately $181 billion every year.

For a complete list of videos, visit our video library