Mistake in a counting-corrector

Hello! I am learning how to use c++, but I just got into a problem that I can't solve. Somebody, please help me, what have I done wrong. It would be a program that says if you counted correctly or not.

#include <iostream>

using namespace std;

int main()
{
int a, b;
cout << "Say a number" << endl;
cin >> a;
cout << "Take it 3x" << endl;
cin >> b;
if(b=a*3)
{
cout<<"Correct!"<<endl;
}
else
{
cout<<"Wrong!"<<endl;
}
}
= is for assignments.
== is for comparisons.
Topic archived. No new replies allowed.