I want a very short code (maximum 6 lines code) for identifying the given input is prime number or not ???
shubham05
0
Newbie Poster
Recommended Answers
Jump to PostWe're not going to write it for you.
You should already know that a prime number is a number that is only divisible by 1 and itself.
So, the most trivial way to check if p is prime is to check to make sure it's not divisible by any number …
All 3 Replies
Hiroshe
499
Posting Whiz in Training
hericles
289
Master Poster
Featured Poster
shubham05
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.