I'm doing an exercise with the C language to calculate the BMI, it does not give any error in the compiler but the result goes all wrong, I already looked at the code and did not find the error at all.
The code is as follows:
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL,"PORTUGUESE");
printf("Claculo de imc\n");
//variaveis peso e altura
double peso;
double altura;
printf("Por favor digite seu peso: ");
scanf("%f",&peso);
printf("por favor digite sua altura: ");
scanf("%f",&altura);
double imc;
imc = peso/(altura *altura );
printf("Seu imc é de %.2f",imc);
system("pause");
return 0;
}