For loop output?

Mar 23, 2017 at 2:23am
After for loop is run, what will be the values in the array?

1
2
3
4
5
int number[5] = {1};
		for(int i = 0; i < 5; i++)
			if(i % 2 == 0)
			number[i] = 2 * i;
		
Mar 23, 2017 at 2:41am
Try it.
0 0 4 0 8
Topic archived. No new replies allowed.