Thread: Prime number
View Single Post
  #1 (permalink)  
Old October 2nd, 2011, 05:56 AM
Twister123 Twister123 is offline
Registered User
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Prime number

task is to idetify if the given K is prime or not.
Prime number is the number that can be divided by 1 and by itself ONLY.
If given number is prime output "YES",otherwise ouput "NO".

Input:
Only one line with n number.(1<=N=<1000)
Output:
Only one line with "YES" or "NO".
Sample input 1:
4

Sample output 1:
NO

Sample input 2:
7

Sample output 2:
YES
Reply With Quote