#include<stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
void Multiply2Nos (float x, float y) {
float result = x * y;
printf("%.3f X %.3f = %.2f\n",x,y,result);
}
int main () {
Multiply2Nos(3.8,5.3);
Multiply2Nos(M_PI,2);
return 0;
}
identifier "M_PI" is undefined
Anyone knows why this happens?
It compiles fine (gcc cygwin) but this error keeps coming up while showing error sqiggles in vs code.
Im sure the include path is correct.
I tried checking if the include path is coorect (it is). The problem is with vs code it dosnt recognize variables defined in math.h how do i fix this?.This issue exists in other test editors as well idk why. I tried the same code in an ide called "codelite" and it too showed the same error but compiled fine.