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
Answers
Answered by
0
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
Similar questions
Physics,
1 month ago
India Languages,
2 months ago
Science,
2 months ago
Math,
9 months ago
English,
9 months ago