What do you do when you need to execute certain statements more than once? You put them in a loop. Loops are very powerful. Majority of coding questions need loops to work. You can't even input testcases without loops!
Here, we will use for loop and check if the given number n is prime or not.
Note: A number is prime if it's divisible by itself and 1. Also, 1 is not prime.
First line of input conatins number of testcases T. For each testcase, there will be one line of input containing a number n.
For each testcase, print "Yes" if n is prime, else print "No".
Your task is to complete the provided function.
1 <= T <= 10
1 <= a <= 1000
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.