Prime number validation-JAVA regex
Basic Accuracy: 34.68% Submissions: 1157 Points: 1

Check the given number is prime or not using JAVA regex.

Input:
First line consists of T test cases. Only line of every test case consists of an integer N.

Output:
Print "1" if the given number statement is prime else 0.

Constraints:
1<=T<=100
1<=N<=1000

Example:
Input:

2
3
4
Output:
1
0

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.