a little help?

Hello, I'm trying to write a little code
Here it is

#include <iostream>

using namespace std;

int main()
{
double mark;
cout<<"Enter your mark = ";
cin>>mark;

if ( mark = 100 )
{
cout<<"You got a perfect score!\n";
}
else if (mark>=59)
{
cout<<"You got F\n";
}

system("pause");

}


Everything runs smoothly but no matter what number I input the result always says "You got a perfect score" when I clearly declared to only state that statement if mark = 100
What seems to be the problem?
Comparison for equality is ==. = is the assignment operator.
That is because the operator= is the assignment operator, you need to use operator== for comparison.

Thanks guys.
Topic archived. No new replies allowed.