123456
while (i=N) i++; { if (i % d ==0) cout << i; }
123
for(i = 1; condition_for_the_loop_to_continue; i++){ //what you wrote }
while (i=N)
for ( int i = 1; i <= N; i++ ) { if ( i % d == 0 ) cout << i << endl; }