1. Engineering
  2. Computer Science
  3. in java please write a method called andprinterint n and...

Question: in java please write a method called andprinterint n and...

Question details

In Java, please write a method, called andPrinter(int n) and a main method to test. "andPrinter" takes in a positive integer as a parameter and then prints the integer with "&" between the digits. So if the number is 4325 it would print out 4&3&2&5. If the number is 5 (ie single digit), you would just print out 5. You must use recursion, no loops, and no data structures (i.e. no arrays or Strings, ArrayLists, etc).

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution