Data Structure and Algorithms in Java
A prime number is a natural number greater than 1 that has no positive divisors other than
1 and itself.
On the other hand, a composite number is a natural number greater than 1 that is not a
prime number.
For example, 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the
divisors 2 and 3 in addition to 1 and 6.
Write a java method isPrimeNum that takes the number n, and checks whether the number
is prime or composite. The method should print at the end a message that indicates whether
n is prime or composite.
asked by
ahmad
Respond to this Question
Similar Questions

math
Can someone help me with prime and composite numbers? Prime numbers are counting numbers that can be divided evenly bt only two numbers:1 and themselves. A prime number can also be described as a counting number with exactly two 
PRECALC
A number is selected at random from the set {2, 3, 4, … ,10}. Which event, by definition, covers the entire sample space of this experiment? A) The number is greater than 2. B) The number is not divisible by 5. C) The number is 
algebra
Are the following true or false? 1. The difference of two natural numbers is always a natural number. 2. The sum of two natural numbers is always a natural number. 3. The quotient of two natural numbers is always a natural number. 
Math
Find the smallest number N such that: The number of divisors of N is A. The number of divisors of A is B. The number of divisors of B is C. The number of divisors of C is 3. Details and assumptions The divisors include 1 and the 
Math
The number p is the product of three different positive prime numbers greater than 2.If the sum of these three prime number is also prime, what is the smallest possible value for p? Won't the 3 number be 3511? Thanks 
Math
Tickst number 115are placed in a hat ,2 Tickets Are drawn at random without replacement find the probability that both Numbers Are Greater then 9 B.) the First Number is Prime and the Second number is Composite? 
Maths
Different between two natural number is 24 the bigger number is four time greater than the smaller number find the number 
math
1) the average of four positive numbers is 15. The second number is 2 times the first number. The third number is twice the second. The last number is the last square of the first number. what is the largest number? 2) suppose 
Math
There are 13 flavbors at a local ice cream parlor. Is the number 13 a prime number or a composite number? If it is composite, write the number as the product of prime numbers 
Maths
Difference between the two natural number is 24 . The bigger number is four time greater than the smaller number , find the numbers.