Question: codeblocks C program COSC1320 - Week 6 - Assignment 6 Exercise on loops Point value 25 points 4. 6. Write a program that has the
COSC1320 - Week 6 - Assignment 6 Exercise on loops Point value 25 points 4. 6. Write a program that has the following loops: 1. A 'while' loop that prints out the numbers 1 through 10. 2. A 'while loop that prints out the numbers 10 through 100, in steps of 10. 3. A do - while' loop that prints out the numbers 1 through 10. A do - while' loop that prints out the numbers 10 through 100, in steps of 10. 5. A 'while' loop that prompts the user for a number, and stays in the loop until they enter a number greater than e. (we are saying that we want a Positive number greater than zero) A 'do - while' loop that prompts the user for a number, and stays in the loop until they enter a number less than or equal to e. (we are saying we want a negative number (or zero)). A 'while' loop that prompts the user for a char answer, and stays in the loop until an answer of a"y (or a"Y) is entered. (y or Y is good - gets us out of the loop ) A 'for' loop that iterates 10 times and prints out the numbers through 9 (one number per iteration). A 'for' loop that iterates 10 times and prints out the numbers 9 through (one number per iteration), use steps of 10. A for" loop that loops 5 times, asking the user for a number each time, and printing out the loop iteration number, and the number they entered times the loop count. (Example output: Enter a number: Loop count: 1 Answer 5 Enter a number: Loop count: 2 Answer 6 Enter a number: 42 Loop count: 3 Answer 126 ) 7. 8. 9. -1. 5 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
