Coverting to C++

Hey i need a help to convert a line into C++ format.

For n ← Location - 1 to 0 && i - 1

Thanks
Last edited on
A c++ for loop looks like this:

for (initial, condition, action)

initial can declare a variable scoped only to the loop or use existing variables. so you typically see that, in this format:

for(int i = 10; i >=0; i--) //start at 10, until = to zero, subtract 1 each time.
{
//loop body code
} //the created variable i is gone after the loop ends here!



Last edited on
Topic archived. No new replies allowed.