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
Help with this please anyone
Vsevolod [243]

Answer:

       trojan horse

         worm

         virus

        spyware

Explanation:

gimme the brainliest hehe

3 0
3 years ago
Read 2 more answers
TECHNICAL TERMS: the adderess of a website
riadik2000 [5.3K]
Yes very interesting
6 0
3 years ago
HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
Mumz [18]

Answer:

The explanation is for 10 inputs though. You'd have to follow these steps to find input 50 numbers.

Explanation:

This is how I wrote it in the Plain English programming language which looks like pseudo-code but compiles and runs (to save you all the rest of the steps):

To run:

Start up.

Write "Enter 10 numbers separated by spaces: " on the console.

Read a reply from the console.

Loop.

If the reply is blank, break.

Get a number from the reply.

Add 1 to a count.

Add the number to a total.

Repeat.

Write "The total is: " then the total on the console.

Put the total divided by the count into an average.

Write "The average is: " then the average on the console.

Refresh the screen.

Wait for the escape key.

Shut down.

3 0
3 years ago
How do users log into Windows 8?
bogdanovich [222]
I think it’s swipe up if i’m correct, if not sorry
5 0
3 years ago
Read the following scenario: A project will require more people than originally estimated. Identify the possible risks to the pr
egoroff_w [7]
A ideas and creativity
8 0
3 years ago
Read 2 more answers
Other questions:
  • When inside a closed work environment, its okay to openly talk with co-workers about PII
    6·1 answer
  • Press the ____ key(s) to erase one character to the left of the insertion point.
    10·2 answers
  • Internally, computers are constructed from circuitry that consists of small on/off switches. What is the most basic circuitry-le
    12·1 answer
  • What is the system of phonographic disc recordings paired with a projector called?
    9·1 answer
  • How to make changes to a file on the USB drive
    6·2 answers
  • __________ is a protocol used by e-mail clients to download e-mails to your computer.
    14·1 answer
  • I can't get my screen to scroll down when answering questions in brainly. Help?
    13·1 answer
  • Can someone please type a code that makes a house in python and turtle graphics i need help
    9·1 answer
  • Create a Flowchart and write pseudocode for a program that allows the user to enter two integer values: a and b.
    8·1 answer
  • Help plz. due yesterday
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!