make a program with language 1.python to display odd values from 1-100 and even values from 100-1
PROGRAM:
#Initializing variables
start=1
last=100
count=0
#Printing statement
print("Odd values from 1-100")
#Iterating loop
for num in range(start, last+ 1):
# checking condition
if num % 2 != 0:
#Printing odd value
print(num, end = " ")
#Count used print 10 element per line
count=count+1
if(count%10==0):
print()
#Printing statement
print("\nEven values from 100-1")
#Iterating loop step by -1 to decrement
for num in range(last, start-1, -1):
# checking condition
if num % 2 == 0:
#Printing even value
print(num, end = " ")
#Count used print 10 element per line
count=count+1
if(count%10==0):
print()
SCREENSHOT OF THE PROGRAM:
Step by step
Solved in 3 steps with 3 images