answersLogoWhite

0

Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a Prime number.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor

Add your answer:

Earn +20 pts
Q: Write a java program to display the number is prime or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp