I'm getting this error when trying to compile my code...
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
void powRec(long int firstrNum, long int secondNum)
{
int n;
if (secondNum == 1)
;
{
printf("The result is %ld", firstrNum);
return;
}
n = firstrNum * powRec(firstrNum, secondNum - 1);
printf("The result is %ld.", n);
}
int main()
{
powRec(-2, 3);
return 0;
}
I wonder if the problem is in the printf or am I missing something?