Odd numbers Title: Odd numbers up to given number Program: n=int(input("Enter n value\n")) for i in range(1,n+1): if(i%2==1): print(i) Output: Enter n value 20 1 3 5 7 9 11 13 15 17 19 Share Get link Facebook X Pinterest Email Other Apps Share Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment