-1
I’m trying to write this code using recursiveness:
#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 shown to me
F:\Atividade 47.c|7|error: expected ')' before 'i'|
I’ve changed everything possible and so far nothing has worked, someone can help me solve this problem?