This C Program Analyzes if you’re underweight, overweight or obese and accordingly suggests you to gain or lose the right amount of weight in the right period of time.
#include <stdio.h>
#include <conio.h>
#include <math.h>main()
{
int weight;printf(“Welcome to your Weight Analyser\n“);
printf(“To begin, Enter your current weight in pounds(lbs)\n\n“);
scanf(“%d“, &weight);printf(“You currently have %d calories inside you.. In other words, If you lose %d calories, you’ll dissapear altogether ;) Just Sayin!\n\n“, weight*(3500), weight*(3500));
int height_ft, height_in;
printf(“Now, to calculate your ideal weight, Enter your height.. How many feet?)n“);
scanf(“%d“, &height_ft);
printf(“And inches?nn“);
scanf(“%d“, &height_in);int bmi=(703*weight)/pow(((height_ft)*12+(height_in)),(2));
if(bmi<18.5)
{
printf(“You’re underweight, You need to gain weight.. How does that feel?\n“);
}else if(18.5<bmi && bmi<25)
{
printf(“You don really need to lose any weight, Your height and weight are in proportion! :)\n“);
}else
{
if(25<bmi && bmi<30)
{
printf(“You’re overweight! :) Let’s see what I can do you make you live longer and happier :).. \n\n“);
}
else
{
printf(“How do you even breathe? You’re obese and sick! But I can help.\n\n“);
}int ideal_weight=(24.9/703)*(pow(((height_ft)*12+(height_in)),(2)));
printf(“Considering your height will not increase anymore, For your ideal weight, You should reduce to %d \n\n“, ideal_weight);
printf(“Which means you’ll need to shed %d pounds\n\n“, weight–ideal_weight);
printf(“For healthy weight loss, you should take %d days to do this by losing 500 calories each day\n\n“, 7*(weight–ideal_weight));
printf(“To do this, make sure that the calories you burn everyday are 500 more than the total calories you take in everyday.\n Good Luck \n“);}
getch();}
Download the Application (.exe)




