Alyssa R.

asked • 06/10/20

Computer coding hw question

  1. What sort of runtime error will occur when this program is run?

void countdown () {

  int i = 100;

    int n = 5;

  while (i > 0) {

i = i -n;

n = n / -1;

print (i + n) ;


  1. Divide by zero
  2. Uninitialized memory read
  3. Memory access violation
  4. Infinite loop



(If someone could please help me understand this it would be very much appreciated, thanks!)


2 Answers By Expert Tutors

By:

James G. answered • 06/10/20

Tutor
4.9 (1,012)

Skilled at programming and problem solving

Patrick B. answered • 06/10/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.