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 21 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
Excellent


Dinolord

  • Member
  • Posts: 313
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

More than 30% of American adults, and about 12% of children utilize health care approaches that were developed outside of conventional medicine.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

Approximately one in four people diagnosed with diabetes will develop foot problems. Of these, about one-third will require lower extremity amputation.

Did you know?

Dogs have been used in studies to detect various cancers in human subjects. They have been trained to sniff breath samples from humans that were collected by having them breathe into special tubes. These people included 55 lung cancer patients, 31 breast cancer patients, and 83 cancer-free patients. The dogs detected 54 of the 55 lung cancer patients as having cancer, detected 28 of the 31 breast cancer patients, and gave only three false-positive results (detecting cancer in people who didn't have it).

Did you know?

Historic treatments for rheumatoid arthritis have included gold salts, acupuncture, a diet consisting of apples or rhubarb, nutmeg, nettles, bee venom, bracelets made of copper, prayer, rest, tooth extractions, fasting, honey, vitamins, insulin, snow collected on Christmas, magnets, and electric convulsion therapy.

For a complete list of videos, visit our video library