Hi everyone,
I spent 2 hours trying to make this code work but I couldn't do it.
Can someone point out what I'm missing or what I'm doing wrong?
Thanks in advance.
#include<iostream>
using namespace std;
bool isFactor(int a,int b);
int main()
{
int num1, num2;
cout<<"Enter a number: ";
cin>>num1;
cout<<"The factors of "<<num1<<" are: ";
for(num2=2; num2=1; num2++);
{
if (isFactor (num1%2==0));
cout<<num2<<" ";
num2=2;
}
cout<<endl;
return 0;
}
bool isfactor(int a, int b)
{
if(a/b)
return true;
else
return false;
}
This problem is about printing all the factors of any integer on the screen.
Yes is homework and I really tried doing it (you can see some errors) but as I said it's not working for me. Some guidance would be great.