The following code is giving an error. But when I declare the string static then the same code works.
char* check(int x1, int x2)
{
char str1[]= "YES";
char str2[]= "NO";
if((x2-x1)>0)
return str1;
else
return str2;
}