eg income 20weight, and 1.80 height, you get imc < 18.50. and I want to return the assigned string in overweight in the function. to say in console, 'You are overweight'.
#include <stdio.h>
char calculoimc(float peso, float altura)
{
char sobre_peso='Estas sobre peso';
char estado_salud;
float imc=0;
imc = peso/(altura*altura);
if(imc < 18.50){
estado_salud=sobre_peso;
return estado_salud;
}
}
int main(){
float p,a;
printf("Introduzca su peso: ");
scanf("%f",&p);
printf("Introduzca su altura: ");
scanf("%f",&a);
printf("Su estado es: %s",calculoimc(p,a));
}