Search:

Type: Posts; User: arbitel

Search: Search took 0.01 seconds.

  1. Thread: For loop

    by arbitel
    Replies
    6
    Views
    934

    Thanks. The reason I was confused was because the...

    Thanks. The reason I was confused was because the sum=a[i][j] in the for loop. Usually for loop only has a intialization, condition and increment but not the first term. Anyways, thanks !
  2. Thread: For loop

    by arbitel
    Replies
    6
    Views
    934

    Can you explain more on that ? Sorry I am new to...

    Can you explain more on that ? Sorry I am new to C++.

    So would it be


    for (k=i-1; k>=0; k--) {
    sum=a[i][j]
    sum -= a[i][k];
    }
  3. Thread: For loop

    by arbitel
    Replies
    6
    Views
    934

    For loop

    Hi I am not quite sure what this for loop means


    for (sum=a[i][j], k=i-1; k>=0; k--) sum -= a[i][k];

    Why is there a sum=a[i][j] in the for loop ? Is it initiated every single time or how does...
Results 1 to 3 of 3