1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Neko [114]
3 years ago
6

Please help me on this coding problem :)

Computers and Technology
1 answer:
Vesnalui [34]3 years ago
4 0

Answer:

a=4 , b=1

Explanation:

I'm not a computer science major at all but I think I can help you with this code.

Our program wants us to add 2 to a get new a value while also subtracting 1 from b value to obtain new b value. We we want to for for as long b is not 0 and a/b is nonnegative.

One round we get:

New a=0+2=2

New b=3-1=2

Let's see if we can go another round:

New a=2+2=4

New b=2-1=1

We can't go another round because b would be negative while a is positive which would make a/b negative. So our loop stops at this 2nd round.

a=4 , b=1

Other notes:

2nd choice makes no sense because a is always going to increase because of the addition on a and b was going to decrease because of the subtraction on it.

Third choice makes no sense because a/b doesn't even exist.

Fourth choice a/b is negative not nonnegative.

You might be interested in
Match the following technologies with their applications.
otez555 [7]

1. autonomic computing

2. virtualization

3. screenless displays

3-D printing

6 0
4 years ago
Which of the following information is okay to share on social networking site?
zvonat [6]
C. Your hobbies and interests
4 0
3 years ago
Read 2 more answers
What can you do to keep safe when using a ladder?
dexar [7]
If the ladder is not stable, it is better to have someone hold the ladder in the bottom ( only someone who is strong and confident)
6 0
3 years ago
The program to check the highEst of n numbercan be done by ......,..
swat32

Answer: Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value.

Explanation: If you need more help follow me on istagram at dr.darrien

-thank you

7 0
3 years ago
What’s the difference between the alternative press and a tabloid?
miskamm [114]

Answer:

Alternative Press just differs in opinion from mainstream media. A tabloid is literally smaller and is contains sensationalist and largely photographic content.

Most alternative presses aren't reliable and are effectively tabloids in nature, but their content differs.

4 0
2 years ago
Other questions:
  • Respond to the following in a paragraph of no less than 125 words. What is the purpose of netiquette guidelines?
    10·1 answer
  • Describe an application where a parallel circuit might work better than a series circuit
    15·2 answers
  • Using caller id is part of which step in an effective time management plan
    10·1 answer
  • According to the family life course development framework, the __________ stage of the family life cycle comes to an end with th
    7·1 answer
  • 13. The Save As command is useful if you want to copy an open document and
    7·2 answers
  • Assuming your computer only has one network card installed; explain how your virtual machine is able to share that card with you
    10·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • Non-preemptive Shortest Job First (SJF) scheduling policy is not optimal if:
    7·1 answer
  • Fill in the blank; "As well as their traditional role of computing data, computers are also extensively used for..."
    14·1 answer
  • _____ include the people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!