Prime Numbers

3.2

4 votes
Problem

Given a number n, tell if it is a prime number. Print 1 if it is a prime number and print 0 if the given number is not prime.

Input :

A single integer n.

Output :

1, if the number is prime.
0, if the number is not prime.
Print a \n after the answer.

Constraints :

2<=n<=100

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Since 5 is a prime number, the output is 1.

Editor Image

?