0

Question regarding loops

For ( j=1 ; j < n ; j + = ) In this loop what does j + = mean ?

17th Jul 2022, 4:28 AM
Laukesh singh
Laukesh singh - avatar
2 odpowiedzi
+ 5
Addition assignment for (j=1 ; j < n; j += i) // the value "i" will be added to the current value "j" for each loop until the value "j" becomes "n"
17th Jul 2022, 5:04 AM
SomeAwesome
SomeAwesome - avatar
+ 2
j += is incomplete statement. In addition to explained j += i, If You may mean j++; then j value incremented by 1. It is short of j += 1. And j += i is short form of j = j + i ;
17th Jul 2022, 10:13 AM
Jayakrishna 🇮🇳