I shouldn't even use the modulo command in there..
s = s+i; It adds the last number from the loop (value of n) to s (because i!=n). It might be written as s = s+n as well. i = 2+3+4+5+...+n. There...
Type: Posts; User: yellowglow
I shouldn't even use the modulo command in there..
s = s+i; It adds the last number from the loop (value of n) to s (because i!=n). It might be written as s = s+n as well. i = 2+3+4+5+...+n. There...
This is the output: 3136
Is my code so messed up?
I am not sure if this is what you mean, but these are the conditions that must be met.
1 <= i <= n
i = 1+2+3+4+...+n
s = sum of i
I'm done with the exercise and this is my outcome:
...
I took 3 java classes so far, so I don't know it yet.
Hi,
I have an assignment to do, I've been trying to do it, but I just can't find the right solution..
- What is it about?
- About an algorithm 1+2+3+4+...+n=t
(e.g.)
Input: 3, Outcome:...