0
How to ask the user to prompt binary numbers as strings??
i need to create a program that gives base 3 equivalent to base 10. I the program almost done. until I noticed that I had to ask the user to prompt the binary numbers as strings.
2 Antworten
0
The user always prompts a string. When you read the input in your program you should think what type of input you expect. If you want the binary number to be a string just read it like a string, not as a number.
0
You can try printBin(input.nextInt());