MeetCode
Home
Doubts
Why is my C function not returning the …
Solved
1
49
Ask Doubt
View All Doubts
Solvers Leaderboard
Tutorials
Quiz
All Tests
Leaderboard
My Tasks
User Login
Dark
Enable Notifications
Toggle navigation
Prime Check
Computer Mathematics
Easy
2 views
Back to Questions
View Answer
0
Previous
Euler Totient By Factorization
Hard
P
Next
Next Prime
Medium
N
Problem Description
Print YES if n is prime.
Input Format
One integer n.
Output Format
YES or NO.
Sample Test Case
Input:
29
Output:
YES
Constraints
0
Official Solution
Handle n<2 NO. Try divide by i=2..sqrt(n). If any divides NO else YES.
Please
login
to submit solutions and comments.
Solutions (0)
No solutions submitted yet. Be the first!
Discussion (0)
No comments yet. Start the discussion!
Prev
Next
Fullscreen Editor
0 lines • 0 chars
Esc close • Tab indent
No comments yet. Start the discussion!