0
Whats the wrong this code
3 Réponses
+ 8
nextChar() is not a method that the Scanner object contains. It's just next().charAt(0).
Aside from that it works. However, code playground does not support multiple inputs, so you will have to use this code on a different compiler. Ik it sucks, but just the way code playground is designed.
+ 6
There's not 'nextChar()' method... replace it with:
// x =sc1.nextChar();
x =sc1.next().charAt(0);
However, by using 'int' type for your number variables, the result of the division will be an integer too, so 3/2 return 1 ^^
0
thank you