I'm trying to write this code using recursion:
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int potencia(int i, int j)
{
return (j > 0) ? 1 : (potencia(i , j)i * j - 1) * i;
}
int main(void)
{
setlocale(LC_ALL, "");
int valor1;
int valor2;
printf("Insira um valor: "); scanf("%i", &valor1);
printf("Insira outro valor: "); scanf("%i", &valor2);
printf("Resultado da potencia: ", potencia(valor1, valor2));
return 0;
}
But an error is displayed to me
F:\Atividade 47.c|7|error: expected ')' before 'i'|
I have changed everything possible and so far nothing has worked, can anyone help me solve this problem?