Question: Write a program that uses while loops to perform the following steps. 1. Prompt the user to input two integers: first number and second number
Write a program that uses while loops to perform the following steps. 1. Prompt the user to input two integers: first number and second number (first number must be less than second second). 2. Output all odds numbers between first number and second number, e.g. if numbers entered are 1, 2, 3, 4, 5 then only 2, 3, 4 are in between numbers in this case. 3. Output the sum of all even numbers between the first number and the second number. 4. Output the numbers and their squares between 1 and 10. 5. Output the sum of the square of the odd numbers between first number and the second number. Write a program that uses for loops to perform the steps in Lab5a. Write a program that uses do-while loops to perform the steps in Lab5a. For example: If (10% 2== 0)//this is an even number whenever remainder is 0 If (11% 2 >0)//this is an odd number whenever remainder is greater than 0 You can choose to use the POW() function to get exponents (refer to the book for farther details) Suggestion: study the program examples in the book before coding, also do one step at a time. Don't do too much from the beginning. Test, chest and be sure before moving on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
