Page 114 - KEC Khaitan C8 Flipbook
P. 114
Bonus Challenge:
∑ Modify the program to:
o Generate odd numbers instead of even numbers.
o Take an additional input for a step value (e.g., increment the range by 2 or more).
∑ Write a program to calculate the sum of the even numbers in the range.
∑ Enhance the program to handle invalid inputs (e.g., non-integer values or reverse ranges).
Troubleshooting Tips:
∑ Incorrect Range Values: Ensure the start value is less than or equal to the end value.
∑ No Output Displayed: Check if there are even numbers within the given range.
∑ Error Messages: Verify that the user entered valid integer inputs.
112 Premium Edition-VIII

