Guys! I need some help over here. I have problem making this program.
I need to create a program that will ask the user to enter a positive integer, once the number has been entered, display all even factors and then followed by all odd factors.
Now, I only know how to display all the factors, I don't know how to seperate odd from even factors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main()
{
int num,x;
cout<<"Enter an integer: ";
cin>>num;
for (x=1;x<=num;x=x+1)
{
if (num%x==0)
cout<<"One of the factor of integer entered is "<<x<<endl;
}
system("pause");
return 0;
}