#i dont know how to make this work
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
what is stopping you?
yeah, looks good for the beginning
well you should prefer:
int userNum = scnr.nextInt();
on one line instead of splitting it
same with divNum
idk how to get the first result to divide to make second result and thrid
make another variable
that stores the current number
like totalNum?
I would call it current or smth
you dont even need a third variable
you can just rename the userNum to current and use that
well you can just reuse current
oh
like
current = userNum / divNum;
// print
current = current / divNum; // this can be simplified using current /= divNum
// print
...
and how do i make the out put like that
where it shows 3 results?
in one line
use System.out.print instead of println
it is important at which point you print
as you update the variable over and over again
so the first output would be the first result of the division
well logically go through the code step by step
with the example input 2000 and 2
current = userNum / divNum; // current = 1000
// print
current = current / divNum; // current = 500
// print
...
so you need to print in between the updates
it is asking for a println at the end
so use println for the last one
oh i see
this is what they describing in:
Note: End with a newline
depends what you want
println just adds a \n at the end which puts you to the next line
its just for line breaks
ah i seee
the question asked for it, so you were supposed to add it at the end
so if you want them together just print but if you want new line println?
yeah
ok ok
most of the time you are going to use println
thank you so so much
yeah, but if its not related to this question then make a new thread preferably
ok
