Friday, February 1, 2019

Multiple Layer a and b

  • Problem Description

    Write a program to find the numbers divisible by a input numbers within the given range

    Input 1:Lower range
    Input 2:Upper range
    Input 3:Positive number
    Input 4:Positive number

    Output:Numbers divisible by given input numbers within the specified range

    Refer sample input and output for formatting specification.
  • CODING ARENA
  • a=int(input())
    b=int(input())
    c=int(input())
    d=int(input())
    for i in range(a,b+1):
        if(i%c==0 and i%d==0):
            print(i)
  • Test Case 1

    Input (stdin)
    10
    
    100
    
    5
    
    7
    
    
    Expected Output
    35
    
    70
  • Test Case 2

    Input (stdin)
    15
    
    1000
    
    2
    
    100
    
    
    Expected Output
    100
    
    200
    
    300
    
    400
    
    500
    
    600
    
    700
    
    800
    
    900
    
    1000

No comments:

Post a Comment