Help please!

What are the values of i and n after this loop executes?

int n = 0;
for (int i=0; i < 4; i++)
{
n = n + 5;
}


i = 0 and n = n + 5. duh.
closed account (zb0S216C)
i is popped and n is left with 20.

Instead of asking these silly questions, why not use std::cout << n << std::endl to find out yourself? Is there really any point in posting a question like this?

Wazzak
Topic archived. No new replies allowed.