จะเพิ่ม เพิ่มเกณฑ์มาตฐาน ผู้ชายกับผู้หญิงมีค่า BMI ที่แตกต่างกัน
นำข้อมูล BMI คนเอเชีย คนยุโรป ว่าแตกต่างกันอย่างไร
อันนี้คือโค้ด
ช่วยทีครับ เพิ่มเข้าไปยังไง บอกหน่อยครับ
#include <stdio.h>
char n[20];
float w,h,BMI;
main()
{
printf ("\n\t\tWelcome to program calculate BMI \n");
printf ("\n\n\t\tBody Mass Index Program");
printf ("Input your name : ");
scanf ("%s",&n);
printf ("\n\n\t\tWeight(kg.): ");
scanf ("%f",&w);
printf ("\n\n\t\tHeigth(m.): ");
scanf ("%f",&h);
BMI = w/(h*h);
printf("\n\n\t\tHi! %s. You have BMI. = %.2f",n,BMI);
if(BMI>40)
{ printf ("\n\n\t\tyou are very very fat. It dangerous.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should exercise regulary.");
}
else if (BMI>35)
{ printf ("\n\n\t\tYou are very very portly.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should exercise sometimes.");
}
else if (BMI>28.5)
{ printf ("\n\n\t\tYou are very very plump.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should mini exercise.");
}
else if (BMI>23)
{ printf ("\n\n\t\tYou are chubby.");
printf ("\n\n\t\tYou are healty.");
printf ("\n\n\t\tYou can eat clean food.");
}
else if (BMI>18)
{ printf ("\n\n\t\tYou are slim.");
printf ("\n\n\t\tYou can eat everything.");
printf ("\n\n\t\tYou should exercise.");
}
else
{ printf ("\n\n\t\tYou are very very thin.");
printf ("\n\n\t\tYou should to eat very much.");
printf ("\n\n\t\tYou should exercise.");
}
getch();
}
Dev c++ โปรเจค bmi เพิ่ม ค่ายังไง ช่วยทีครับ
นำข้อมูล BMI คนเอเชีย คนยุโรป ว่าแตกต่างกันอย่างไร
อันนี้คือโค้ด
ช่วยทีครับ เพิ่มเข้าไปยังไง บอกหน่อยครับ
#include <stdio.h>
char n[20];
float w,h,BMI;
main()
{
printf ("\n\t\tWelcome to program calculate BMI \n");
printf ("\n\n\t\tBody Mass Index Program");
printf ("Input your name : ");
scanf ("%s",&n);
printf ("\n\n\t\tWeight(kg.): ");
scanf ("%f",&w);
printf ("\n\n\t\tHeigth(m.): ");
scanf ("%f",&h);
BMI = w/(h*h);
printf("\n\n\t\tHi! %s. You have BMI. = %.2f",n,BMI);
if(BMI>40)
{ printf ("\n\n\t\tyou are very very fat. It dangerous.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should exercise regulary.");
}
else if (BMI>35)
{ printf ("\n\n\t\tYou are very very portly.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should exercise sometimes.");
}
else if (BMI>28.5)
{ printf ("\n\n\t\tYou are very very plump.");
printf ("\n\n\t\tYou should to eat vegetable and fruit.");
printf ("\n\n\t\tYou should mini exercise.");
}
else if (BMI>23)
{ printf ("\n\n\t\tYou are chubby.");
printf ("\n\n\t\tYou are healty.");
printf ("\n\n\t\tYou can eat clean food.");
}
else if (BMI>18)
{ printf ("\n\n\t\tYou are slim.");
printf ("\n\n\t\tYou can eat everything.");
printf ("\n\n\t\tYou should exercise.");
}
else
{ printf ("\n\n\t\tYou are very very thin.");
printf ("\n\n\t\tYou should to eat very much.");
printf ("\n\n\t\tYou should exercise.");
}
getch();
}