Question: Write a Java program which takes in an int x and prints out the distance from x to the nearest prime number. A prime number
Write a Java program which takes in an int x and prints out the
distance from x to the nearest prime number. A prime number is
a number which is divisible only by itself and eg
etc. If x is a prime, then the output should be
Sample input
Sample output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
