Hello everyone! I am a beginner in C++. I am doing a very simple program.As simple it could be i get a error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream.h>
#include <math.h>
usingnamespace std;
int main ()
{
unsigned n,i;
cout<<"n=";cin>>n;
for (i=2;i<=n/2;i++)
{
if (n%i=0) cout<<"i="<<i;/*<=====This is where the error is*/
}
system ("pause");
return 0;
}
and the error I get is this one:
5 II.cpp:10: error: non-lvalue in assignment