Write a Java program that reads a number from the command line and checks whether it is a prime number. A prime number is a number which is divisible only by 1 and the number itself. For instance, 3 is a prime number but 6 is not a prime number

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

Write a Java program that reads a number from the command line and checks whether it is a
prime number. A prime number is a number which is divisible only by 1 and the number itself.
For instance, 3 is a prime number but 6 is not a prime number

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT