Prompts the user to input two integers


Write a program that uses while loops to perform the following steps:
1. Prompts the user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).
2. Outputs all the odd numbers between firstNum and secondNum.
3. Outputs the sum of all the even numbers between firstNum and secondNum.
4. Outputs all the numbers that when squared are between 1 and 10. So if firstNum is greater than
3 there won't be any numbers that when squared are between 1 and 10.
5. Output the sum of the squares of all the odd numbers between firstNum and secondNum.
Some sampe output may look as follows:
Enter firstNum: 2
Enter secondNum: 12
Odd numbers between 2 and 12 are 3, 5, 7, 9, 11
Sum of the even numbers between 2 and 12 = 42
Numbers that when squared are between 1 and 10: 2, 3
Sum of squares of all odd numbers between 2 and 12 = 285

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Prompts the user to input two integers
Reference No:- TGS0134437

Expected delivery within 24 Hours