Menu Close

Find the multiple of given number in the list of integers.

Find the multiple of given number in the list of integers.

Input:
First Line of the Input is the Number of Elements in the List
Second Line of Input has the elements of the List
Third line has has the number for which you have to find the multiples

Output:
Print the Multiples

INPUT
5
6  7  8  13  11
3

OUTPUT
6
N = int(input("Number of Elements: "))
L1 = list(map(int,input("Enter the Elements: ").split(" ")))
Div = int(input("Divisible Number: "))
print("Multiples: ")
for i in range(N):
    if L1[i] % Div==0:
        print(L1[i])

INPUT_1:
Number of Elements:  5
Enter the Elements:  6  7  8  13  11
Divisible Number:  3

OUTPUT:
Multiples:
6


INPUT_2:
Number of Elements:  8
Enter the Elements:  2  4  5  3  7  9  24  10
Divisible Number:  2

OUTPUT:
Multiples:
2
4
24
10


ILLUSTRATION

Executed using python 3

Morae Q!

  1. Convert from binary number to decimal number.
  2. Swap two numbers by using division and multiplication.
  3. Compute foot and inches into centimetres.
  4. Concatenate Strings.
  5. Convert lowercase letters to uppercase letters.
  6. Compute the sum of all the digits of N.
  7. Compute the area of the pentagon.
  8.  Get input using scanner.
  9. Find the distance between two points (x1,y1) and (x2,y2).
  10. Finding patterns in a file using frep and egrep .
  11. Detecting a cycle in a directed graph using Depth First Traversal.
  12. Topological ordering in a Graph.
  13. Storing graphs using adjacency list.
  14. Introduction to graph theory.
  15. Graph Adjacency Matrix pseudo code.
  16. Adjacency Matrix for storing graphs.
  17. Dijkstra’s shortest path algorithm .
  18. Breadth first search (BFS) Algorithm.
  19. Find the multiple of given number in the list of integers.
  20. Finding patterns in files using grep .