DCP-27: Is It Prime? Back to All Problems

Beginner Math > Basic Math


A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. Below is a chart of numbers up to 100 and yellow marked numbers are prime numbers. ![primes][1] We want you to write a program that can check whether a given input number is prime number or not. All number will be in the range **0 <= N <=10000**. Input: ------ Input starts with an integer **T (≤ 5000)**, denoting the number of test cases. Each test case will have one line containing the number to test. Output: ------- For each test case, print either “Yes” (without quotes) or “No” (without quotes). If the input number is prime number then print “Yes”, otherwise print “No”. Please check sample input/output to get an idea. Sample Input ------------ 3 97 55 1000 Sample Output ------------- Yes No No [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/8a279e47-68b0-c989-90c5-08d2e286f36c_b929388111cd4762bbb4ee94dc73332d_W650xH487.jpg


Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 3.00
C# 3.00
PHP 3.00

Problem Stats

245/812

Solve/Submission

Ranking

# User Language Timing
01 nurakib Cpp 0.00s
02 moshiur_cse15 Cpp 0.00s
03 Indro_BU Cpp 0.00s
04 Masum_ice Cpp 0.00s
05 JubayerSohel Cpp 0.00s
06 Ahb_arif Cpp 0.00s
07 NightTrain_404 Cpp 0.00s
08 jayed_al_hasan Cpp 0.00s
09 lazyfahim Cpp 0.00s
10 terminator_c Cpp 0.00s
11 ProMAGFAT Cpp 0.00s
12 snow_man Cpp 0.00s
13 Anubis Cpp 0.00s
14 ash12 Cpp 0.00s
15 sadia2427 Cpp 0.00s
16 shahid_ullah Cpp 0.00s
17 SumonB1 Cpp 0.00s
18 AlaminJust Cpp 0.00s
19 shahad_mahmud Cpp 0.00s
20 7Mahfuz Cpp 0.00s
21 Ratul728 Cpp 0.00s
22 atikhashmee Cpp 0.00s
23 ATIK161 Cpp 0.00s
24 liar Cpp 0.00s
25 return_SS Cpp 0.01s
26 smriad Cpp 0.01s
27 rashidulhasan777 Cpp 0.01s
28 beginer Cpp 0.01s
29 Nazmul_7 Cpp 0.01s
30 FluidCoder Cpp 0.01s
31 Koushik54 Cpp 0.01s
32 Mehedi07 Cpp 0.01s
33 subhashis_cse Cpp 0.01s
34 Snails Cpp 0.01s
35 onucsecu Cpp 0.01s
36 SakibAlamin Cpp 0.01s
37 deder Cpp 0.01s
38 Nazmul0092 Cpp 0.01s
39 nuralam Cpp 0.01s
40 susmoys Cpp 0.01s
41 Mr_KAJOL_JUST Cpp 0.01s
42 noshin_ju Cpp 0.01s
43 Khayrul_34 Cpp 0.01s
44 Alamgir_JUST Cpp 0.01s
45 zitul_mahmud Cpp 0.01s
46 badhansen123 Cpp 0.01s
47 gulzar Cpp 0.01s
48 maxhasan Cpp 0.01s
49 gazi93 Cpp 0.01s
50 Anikcsejnu Cpp 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support