InterviewSolution
Saved Bookmarks
| 1. |
Q6. a) Write a program to display all the odd natural numbers found between 100 and 200 .b) Write a program to display the sum of first 25 natural numbers using for loop. in java |
|
Answer» start = INT(input("Enter the start of range: ")) end = int(input("Enter the end of range: ")) for num in range(start, end + 1): if num % 2 != 0: print(num, end = " ") output: Enter the start of range: 100 Enter the end of range:200 101, 103, 105, 107,............. 197 ,199 |
|