Site icon codemaniacstudio

Write a Python program to print all odd number between 1 to 100.

Write a Python program to print all odd number between 1 to 100.

SOLUTION....

# Program to print all odd numbers between 1 to 100

for i in range(1, 101):   # loop from 1 to 100
    if i % 2 != 0:        # check if number is odd
        print(i, end=" ")

OUTPUT

Exit mobile version