n=int(raw_input(‘Enter the number ‘))
factor=0
for i in range(1,n):
  if n%i==0:
    factor=i
if factor>1:
  print ‘The number is a composite number!’
elif n==1:
  print ‘The number 1 is neither prime nor composite!’
else:
  print ‘This is not a composite number!’

Source link

To check the number is composite number or not

Leave a Reply

Your email address will not be published. Required fields are marked *