(a)
if (ival1 != ival2)
ival1 = ival2; // Missing semicolon
else ival1 = ival2 = 0;
(b)
if (ival < minval) { // Need a block for more than one statements
minval = ival;
occurs = 1;
}
(c)
int ival; // Used outside the first if scope, thus defined outside
if (ival = get_value())
cout << "ival = " << ival << endl;
if (!ival)
cout << "ival = 0\n";
(d)
if (ival == 0) // Should be equality operator instead of assignment
ival = get_value();