Well, you are nearly there, but a little more consistency is good. For example:
Code:
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
string name;
string math;
int a;
int d;
int matha;
cout << "Enter name: \n";
cin >> name;
cout << "Enter math grade " << name << " got: \n";
cin >> math;
if (matha = a)
{
cout << name << " passed \n";
}
else if (matha = d)
{
cout << name << " failed \n";
}
system("PAUSE");
return 0;
}
I took the liberty of removing the superfluous empty statements as including <cstdlib> which is needed for system() (which you do not need to use in the first place), but I did not make the fixes I suggested.