What value will result from the execution of the loop with prefix increment:
int a[4] = {1, 2, 3, 4};
int sum = 0; 
for (int i = 0; i < 4; ++i)
{
     sum += a[i];
}
Explanation
When you use prefix increment in for loop (++i), as well as if you use Postfix increment (i++) the value of the counter i is incremented after the execution of the loop body. View used increment only affects computing performance using ++i is higher.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести