1
Good afternoon guys, I’ve come this far.
#include <stdio.h>
#include <math.h>
int main(void)
{
float val_carro, juros_mensal = juros_mensal / 100, num_parcelas, cf;
printf("\n\n Digite o valor do carro: "); //entrada variaveis
scanf("%f", &val_carro);
printf("\n Digite o numero de parcelas: ");
scanf("%f", &num_parcelas);
printf("\n Digite o juros mensal: ");
scanf("%f", &juros_mensal);
cf = (1 + juros_mensal);
cf = (cf pow num_parcelas); // calculo coeficiente de financiamento
cf = (1 / cf);
cf = (1 - cf);
cf = (juros_mensal / cf);
printf("\n\n O valor de cada parcela é: %f", cf); //exibe valor de cada parcela
printf("\n\n O valor do carro é: %f", cf *= 3); // exibe valor total do carro
return 0;
}
only that on the line that is commented the financing coefficient, the error,
expected')' before 'num_parcels'
then I can’t solve it.
would not be so? cf = (Pow (cf,num_parcels));
– Diego
then I have done so I have isolated all variaves together, and separated from the function and the error persists
– AGenaro
pow
is a C function, not an operator. To use it, as @Diego said, you need to call it as a function as follows:pow(base, expoente)
.– Felipe Avelar
now I managed I left a space in the middle and had not rotated gave error, but I corrected now. Thank you very much!
– AGenaro
I’ll post the answer, for the record.
– Diego