Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Friday 15 December 2017

Python program to check number is Prime

num = input('Please enter a number:')
i = 2
Flag= 0
while i<num:
if num%i ==0
Flag= 1
print ("Your number is NOT a prime number!");
i = i + 1
if Flag == 0:
print ("Your number is a prime number!");

No comments:

Post a Comment