int main()
{
for (register i = 1; i <= 9; ++i)
for (register j = 1; j <= 9; ++j)
cout << i << " x " << j << " = " << i*j << '\n';
return 0;
}
I keep getting two errors saying ISO c++ forbids declaration of 'i' with no type and another one that says ISO c++ forbids declaration of 'j' with no type. I can't figure out what's wrong. I am new to this by the way and doing sample programs and i haved it typed out exactly how they do. Any help would be appreciatied! Thanks.
It's best to always use integer values for loopcounters. Other values may act strange (eg.: a variable of type double with the value 0 after calculations often has a value like 1.42392e-9. If you use that variable in a condition like if (variable==0.0) it returns false.)