int a= 10;
e=b; // e is 6
for ( int i = 2 ; i <= e ; ++i )
if (a % i == 0)
cout << a <<" ";
would help if you tell us what exactly are you trying to achieve with this simple for loop.