Karan likes even numbers very much. He has a very long list of numbers. You just need to print the even numbers from the list. The list ends when -1 is encountered.

Input 
1
4
-1
Output 

  4                                                                                                                                            
Solution

i=0
n=[]
while i<1:
n.append(input())
l= len(n);
if n[l-1]== -1:
i=i+1
for x in n:
if int(x)%2==0:
print (x)
if x== -1:
break;




if you have any problem in this code, take a screenshot and contact with Rishabh Chaubey.

Post a Comment

Previous Post Next Post