❔ Using WHILE to sum numbers from 10 until sum == 1000
Hello, how to make using function while () {} to make numbers from 10 to be sum until result is 1000 for example:
10 + 10 (first time)
20 + 11 (2th time)
31 + 12 (3rd time)
43 + 13 (4th time) and etc until result is 1000 also to print the last number after +
my broken code:
2 Replies
so it has to start with 10 too?
It is making the console empty.
I need to cw only the last number which when you sum it makes 1000
yea i though the same tried adding i++ at the end but it makes some very big number
So I need to make it to sum numbers after 10 and add after number is summed +1 like after 10 to sum the result before with 11 and the final result should be lower than 1000 I did mistake and typed = its only <. At the end it needs to console writeline the last number which was summed for example 35 to make the last number. This is more clear text.
I managed to do it by 10+10 start, code is but I need to start by 10+11 :/
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.