(Solved) : Write Java Method Returns Largest N Digit Coprime Given Integer Integer Largest Co Prime S Q44032024 . . .
Write a java method that returns the largestn-digit coprime for a given integer. The integer for which thelargest co-prime is being searched is passed as the first argumentto the method and the second argument is the number of digits. Incase, an n-digit coprime is not possible, -1 is returned.
For all other error situations, return -2. Cannot use for loopsin this question; use while or do-while.
Cannot use any Math libraries in thismethod.
Cannot use the system.exit(0) anywhere in themethod
Cannot use input/output in method (use main totest)
Expert Answer
Answer to Write a java method that returns the largest n-digit coprime for a given integer. The integer for which the largest co-p…
OR