Question: I need in in java by not comlicated code and not handwriting please Thank you A prime number is a natural number greater than 1
I need in in java by not comlicated code and not handwriting please
Thank you

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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
