Question #298763

Given two integers M, N as input. Write a program to print all the composite numbers present in the given range (including M and N)



Input:



2



9




Expert's answer

M = int(input())
N = int(input())

print("\nComposite numbers between M and N include")
for num in range(M,N+1):
    count = 0
    for diviser in range(2,num//2+1):
        if num % diviser == 0:
            count+=1
    if count >= 1:
        print(num)
LATEST TUTORIALS
APPROVED BY CLIENTS