Write a program While Loops that uses while loops to perform the following steps
ID: 3828993 • Letter: W
Question
Write a program While Loops that uses while loops to perform the following steps: Prompt the user to input two positive integers: first Num and secondNum (firstNum must be smaller than secondNum). Output all the even numbers between firstNum and secondNum inclusive. Output the sum of all the even numbers between firstNum and secondNum inclusive. Output all the odd numbers between firstNum and secondNum inclusive. Output the sum of all the odd numbers between firstNum and secondNum inclusive. Enter an integer: 3 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 = 24 Write a program Stars that uses two nested for loops to output the pattern of stars shown below (note that there are no spaces in between stars). Enter an integer from 3 to 10: 7Explanation / Answer
Below is the required code:-
Program to create triangle of stars:-
Thank you.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.