Alright. I am real new at C++ and have a simple bracket { question.

I am not sure of the placement in a nested if, else if statement. Please help!
Here is an example...It gives the same response no matter what number you enter, although I don't know why:



#include <iostream.h>

void main()
{
//declare and initialize variable
short code = 0;

//get code from user
cout << "Enter the code (1 through 5): ";
cin >> code;

//display salary
if (code = 1)
cout << "$45,000" << endl;

else
if (code == 2 || code == 5)
cout << "$33,000" << endl;

else
if (code == 3 || code == 4)
cout << "$25,000" << endl;

else

cout << "Entry error" << endl;
//end if (code == 3 || code == 4)
//end if (code == 2 || code == 5)
//end if (code == 1)

} //end of main function