Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C# Source Code Lab6C: Well, that's an odd question! The final loop we are going to practice using for this lab is a for loop.
C# Source Code
Lab6C: Well, that's an odd question! The final loop we are going to practice using for this lab is a for loop. Write a program that prompts the user to enter two positive numbers. The program will add all of the odd numbers in between the two inputted values and return the sum. The program must work even if the starting number is larger than the ending number. Hint: Compare a loop that counts "up" to a loop that counts "down." What's the difference? Start by getting sample output #1 and #2 working, then work on #3. A sample run is shown below. User input is in bold. Sample output #1: Enter a starting number: 3 Enter an ending number: 7 Sum of odds is: 15 Sample output #2: Enter a starting number: 10 Enter an ending number: 20 Sum of odds is: 75 Sample output #3: Enter a starting number: 20 Enter an ending number: 10 Sum of odds is: 75Step 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