No products in the cart.

Write a program to to find …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a program to to find the prime number of a series.
  • 1 answers

Sia ? 5 years, 4 months ago

  1. num = int(input("Enter a number: "))  
  2.   
  3. if num > 1:  
  4.    for i in range(2,num):  
  5.        if (num % i) == 0:  
  6.            print(num,"is not a prime number")  
  7.            print(i,"times",num//i,"is",num)  
  8.            break  
  9.    else:  
  10.        print(num,"is a prime number")  
  11.          
  12. else:  
  13.    print(num,"is not a prime number")  
http://mycbseguide.com/examin8/

Related Questions

What is alu
  • 1 answers
Write a program for swapping two numbers?
  • 0 answers
Write a program for swapping two numbers
  • 1 answers
Define packages
  • 0 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App