6.11. Write Code QuestionsΒΆ

Warning

Be careful not to create infinite loops, as they will cause the page to freeze.

Fix the 5 errors in the code below to return a countdown of the numbers from 10 to 0, including 0.

Fix the 5 errors in the code below to return a countdown of the numbers from 10 to 0, including 0.

The following code will loop way too many times. Change one line to make the loop only have five iterations.

Make 5 changes to the code below to correctly print a count up from -10 to 0, including 0.

Make 5 changes to the code below to correctly print a count up from -10 to 0, including 0.

Finish lines 1 and 5 so that the following code correctly prints every integer from -5 to -1, including -1.

Complete the code on lines 4 and 6 so that it prints the number 6.

Complete the code on lines 4 and 6 so that it prints the number 6.

Loading a dynamic question ...
Selecting from: itr-ex-root_ac, itr-ex-root_pp

This function currently takes a start and stop argument and uses a for loop to find the sum of all the numbers between them (inclusive). Change the for loop to a while loop while still using the same parameters.

This function currently takes a start and stop argument and uses a for loop to find the sum of all the numbers between them (inclusive). Change the for loop to a while loop while still using the same parameters.

The program below is supposed to print the times tables from 1 to 3, but there are 6 errors. Fix the errors.

The following code prints the times tables for 1 to 3 using two for loops. Rewrite the program to use a while and a for loop instead.

Loading a dynamic question ...
Selecting from: int-ex-while_ac, int-ex-while_pp

You have attempted of activities on this page