Prime Number
Submissions: 16291   Accuracy:

46.32%

  Difficulty: Basic   Marks: 1

For a given number N check if it is prime or not. A prime number is a number which is only divisible by 1 and itself.

Input:
First line contains an integer, the number of test cases 'T'. T testcases follow. Each test case should contain a positive integer N.

Output:
For each testcase, in a new line, print "Yes" if it is a prime number else print "No".

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

Example:
Input:
1
5

Output:
Yes

Explanation:
Testcase 1:
5 is the prime number as it is divisible only by 1 and 5.

Video:

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

Author: abhiraj26


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.