0
Q:

how many times 2 is multiplied to a number so that it is divisible by 10

# Python3 code for finding number  
# of operations 
def dig(argu):  
    switcher = {  
        0: 0,  
        5: 1,  
    }  
    return switcher.get(argu, -1) 
      
def multiplyBy2(n): 
  
    # Find the last digit or remainder 
    rem = n % 10; 
    return dig(rem); 
  
# Driver code 
n = 28; 
print(multiplyBy2(n)); 
  
n = 255; 
print(multiplyBy2(n)); 
          
# This code is contributed by mits 
0

New to Communities?

Join the community