Prime number validation-JAVA regex
Submissions: 927   Accuracy:

35.08%

  Difficulty: Basic   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Prashant Shukla
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.