#include <stdio.h>
#include <stdlib.h>
#define FALSE 0
#define TRUE 1
main()
{
float weight;
float height;
char age;
double BMI;
int year, mass;
printf("Please enter the year you were born : ");
scanf("%d", & age);
printf("Please enter your weight in kg :");
scanf("%f", &weight);
printf("Please enter your height in meters :");
scanf("%f",&height);
age=2013-age ;
BMI=mass/height;
if (age <= 18)
{
if (BMI >= 19.99)
{
printf("your an underweight child\n");
}
else if ((BMI <=20.00)||(BMI<=28.00))
{
printf("healthy weght child keep working out\n");
}
else if ((BMI <=29.00 )||(BMI<=31.00))
{
printf("You overweight child workout please\n");
}
else if (BMI >= 32.00)
{
printf("you are OBESE!!child \n");
}
else if (age <= 18)
{
if (BMI <=18.50)
{
printf("your underweight\n");
if(BMI <=16.00)
{
printf("Your severe thinness");
}
if((BMI<=16.00)||(BMI<=16.99))
{
printf("your moderate thinness");
}
if((BMI<=17.00)||(BMI<=18.49))
{
printf("mild thinness");
}
}
else if ((BMI <=18.50)||(BMI<=24.99))
{
printf("your normal range \n");
}
else if (BMI >= 25.00)
{
printf("your over weight\n");
if((BMI<=25.00)||(BMI<=29.99))
{
printf("your pre-obese");
}
else if (BMI >=30.00)
{
printf("You are obese\n");
if((BMI<=30.00)||(BMI<=34.99))
{
printf("obese class i");
}
if((BMI<=35.00)||(39.99))
{
printf("obese class ii");
}
if(BMI >= 40.00)
{
printf("your obese class iii");
}
}
system("PAUSE");
}
*** EDIT ***
Please use code tags when posting code
This post has been edited by GunnerInc: 10 March 2013 - 09:52 AM
Reason for edit:: Added elusive code tags

New Topic/Question
Reply



MultiQuote










|