Question: how do I write a MIPS program that asks user how many positive number that is devisable by you want to add? .Then your loop

how do I write a MIPS program that asks user how many positive number that is devisable by you want to add? .Then your loop counter would be the user input. If the user enters a positive number between 1 and 100 that is devisable by 6, you increment your loop counter and add it to the sum.. You need to decide if the positive number entered by the user is divisible by 6 or not. Your program should print an error message if the number is not within the range and ask user for another number

Like this:

How many positive number that is devisable by you want to add? 3

Enter a number: 36 ==> 36 is divisible by 6

Enter a number: -20 ==> **** ERROR: -20 is not a positive number

. Enter another number. Enter a number: 0 ==> **** ERROR: 0 is not in the range of 1 to 100.

Enter another number. Enter a number: 21 ==> 21 is not divisible by 6

. Enter another number. Enter a number: 121 **** ERROR: 121 is not in the range of 1 to 100. Enter another number.

Enter a number: 6 ==> 6 is divisible by 6

Enter a number: 12 ==> 12 is divisible by 6

The Sum of the positive numbers between 1 and 100 that are devisable by 6, is: 54

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!