#include<iostream>
usingnamespace std;
int main(){
int a= 10;
int b=6;
int e;
if (a<b)
{
e=a;
}
else
{
e=b; // e is 6
}
for ( int i = 2 ; i <= e ; ++i )
{
if (a % i == 0)
{
a/=i;
}
cout << a <<" ";
}
return 0;
}
would help if you tell us what exactly are you trying to achieve with this simple for loop.