Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help on this question. I don't know how to use while loops. Can you help me by teaching me what they are and
I need help on this question. I don't know how to use while loops. Can you help me by teaching me what they are and how to use them? thank you.
Part A. Write a program WhileLoops that uses while loops to perform the following steps 1. Prompt the user to input two positive integers: firstNum and secondNum (firstNum must be smaller than secondNum). 2. Output all the even numbers between firstNum and secondNum inclusive 3. Output the sum of all the even numbers between firstNum and secondNum inclusive. 4. Output all the odd numbers between firstNum and secondNum inclusive. 5. Output the sum of all the odd numbers between firstNum and secondNum inclusive. EXAMPLE OUTPUT: Enter an integer: Enter another integer larger than the first one 10 Even numbers 4 6 8 10 Sum of even numbers 28 Odd numbers 3 5 7 9 sum of odd numbers F 24Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started