Search:

Type: Posts; User: yellowglow

Search: Search took 0.12 seconds.

  1. Replies
    9
    Views
    1,475

    Re: Loop Assignment

    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...
  2. Replies
    9
    Views
    1,475

    Re: Loop Assignment

    This is the output: 3136
    Is my code so messed up?
  3. Replies
    9
    Views
    1,475

    Re: Loop Assignment

    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:

    ...
  4. Replies
    9
    Views
    1,475

    Re: Loop Assignment

    I took 3 java classes so far, so I don't know it yet.
  5. Replies
    9
    Views
    1,475

    Loop Assignment

    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:...
Results 1 to 5 of 5