0
User input for arrays
I am doing a programming challenge and i am using an array to let users input factors for a deficient number. However I dont fully understand the concept so whenever I input the factors, they dont print. Can someone explain? My program https://code.sololearn.com/cTzjp7D6Ryvm/?ref=app https://code.sololearn.com/cTzjp7D6Ryvm/?ref=app https://code.sololearn.com/cTzjp7D6Ryvm/?ref=app
1 Resposta
+ 2
Use userInput.nextInt() instead of s.nextInt(). Also, in loop condition, write i < facts.length.
Fixed code: https://code.sololearn.com/csHH1PKFdC4o/?ref=app