I'm a newbie...help

ok guys i'm new in this world of programming and this is one of my first programms is ever did so please help me... it keeps saying "lvalue required as left operand of assignment"...what's to do?


#include <iostream>

using namespace std;

int main()
{
cout<<"power(2,n) last number"
int n;
cout<<"n=";cin>>n;
if (n % 4 = 0); {
cout<<"u=6";
};
if (n % 4 = 1); {
cout<<"u=2";
};
if (n % 4 = 2); {
cout<<"u=4";
};
if (n % 4 = 3); {
cout<<"u=8";
};
}
Assignment: =
Comparison: ==
Please edit your post and make sure your code is [code]between code tags[/code] so that it has line numbers and syntax highlighting, as well as proper indentation.

Please copy and paste the exact error message and indicate which line it is referring to.

Don't put semicolons after the closing parenthesis of if statements.
Last edited on
Topic archived. No new replies allowed.