Quote:
What error I am having in BELOW CODE?
First of all, it is not Java code.
Then try to replace
v=int( input("153"))
rev=0
while 0!=v:
r=v%10
rev=rev*10+rev
v=v/10
print(rev)
With
v=int( input("153"))
rev=0
while 0!=v:
r=v%10
rev=rev*10+rev
v=v/10
print(r)
Quote:
Write a program using only while loops to print all the even numbers from 1 to n
Your main problem is that this code do not fit the requirement, not even remotely.
Read again requirement and try again.