question about for Loop...

hello there c++ experts i just wanna ask question with regard to for loop statement. i have here a sample of for loop statement.

int r;
for(int r=2,j=1;j<=100;r++)
{
cout<<j<<" ";
j=pow(r,2);
}

output: 1 4 9 16 25 36 49 64 81 100

i just wanna know how the output came up...thanks in advance.
Refine your question.
i mean the simulation on how the out put.... became 1 4 9..... 100.?
pow() returns the value of the first parameter raised to the power of the second parameter.

http://www.cplusplus.com/reference/clibrary/cmath/pow.html
ok thanks sir helios for the info.
Topic archived. No new replies allowed.