subject

Given the following code:

if (n==2)
{
k-= 2;
}
else if (n==3)
{
k-=3;
}

can be rewritten as if ()
{
;
}

where < condition > and < assignment statement > are chosen so that the rewritten code performs the same task as the original code. Assume that both n and k are integer variables. Which of the following could be used as < condition >?

I. (n == 2) || (n == 3)
II. (n == 2) && (n == 3)
III. (n >= 2) && (n <= 3)

a. 1 only
b. 2 only
c. 3 only
d. 1 and 3 only
e. 2 and 3 only

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:00, opgbadwolf5
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, LuvIsRage2
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
Answers: 2
image
Computers and Technology, 23.06.2019 19:30, sallybob0
What are loans to a company or government for a set amount of time
Answers: 1
image
Computers and Technology, 24.06.2019 18:00, aleyshamar14p95561
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
You know the right answer?
Given the following code:

if (n==2)
{
k-= 2;
}
else if (n==3)

Questions in other subjects:

Konu
Mathematics, 15.08.2020 23:01