My program wont run it keeps giving me " error C2668: 'cos' : ambiguous call to overloaded function" & " error C2668: 'sin' : ambiguous call to overloaded function " but i have no idea how to fix it.
Line 21: You're passing ints to sin() and cos(). In C++98, sin and cos have overloaded versions accepting doubles, floats and long doubles. The compiler does not know which to use to promote the integer value.
Use a cast to tell the compiler which one you want:
f[i][j] = 2.0 * sin((double)i) - cos((double)j);
BTW, <math.h> is not the correct header for a C++ program.
You should be using <cmath>.