|
From: Heedle B. <hee...@gm...> - 2009-02-04 02:18:16
|
Here is my code:
#include <iostream>
using namespace std;
int main ()
{
int n;
int div = 0;
bool primenum = true;
cout << "Enter an integer: ";
cin >> n;
do {
div = div + 1;
if (n % div = 0)
{
cout << "Divisible By " << div << " ." << endl;
primenum = false;
}
if (n % div != 0)
{
cout << "Not Divisible By" << div << " ." << endl;
}
} while (div <= n / 2 + 1); */* this line has the error*/*
if (primenum == false)
{
cout << "IS PRIME." << endl;
}
if (primenum == true)
{
cout << "IS NOT PRIME." << endl;
}
system("pause > nul");
return (0);
}
And here is my question:
I recieve a non-lvalue error in the line with "this line has the error".
What the heck is a non-lvalue error and how do I fix it?
My system specs (though I don't think they'll matter) :
Microsoft Windows XP
Service Pack 3
Intel Pentium 4
504 MB RAM
3.06 GHZ of processing
Thank you so much.
Heedle
P.S. Please don't disregard my questions because there are so many of them.
I say again, I am new to C++.
|