At line 6 j is uninitialized so it contains whatever random bits happen to be at the location assigned to it. Line 7 assigns i to the uninitialized value of j. Line 10 prints it. If you assign something to j at line 6 then it will print that value.
#include <iostream>
// using namespace std;
int main() {
int i ;
for( int j=0; j<1; ++j /*j++*/ ) {
i = j ; // assign to i *after* giving a well-defined value to j
std::cout << i << ' ' ;
}
// return 0;
}