Write a python program to print all even number upto a given range.

 code:-

r=int(input(“Enter range “))
for i in range(2,r+1,2):
print(i,end=” “)

Output:-

Enter range 50
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50



One thought on “Write a python program to print all even number upto a given range.

Leave a Reply

Your email address will not be published.