This post contains a total of 6+ C Sharp BMI Calculator Program Examples with Source Code. All these BMI ( Body mass index ) Calculator Programs are made using C Sharp.
You can use the source code of these examples with credits to the original owner.
Related Posts
C Sharp BMI Calculator Programs
1. BMI Index Calculator
Made by Mosi B. Source
21 160 50 BMI Index = 19.53 -----> NORMAL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
// Enter your age, Press ENTER
// Enter your height in CM, Press ENTER
// Enter your weight in KG
// Submit
Console.WriteLine("Hi...\nWelcome to BMI Index Calculator");
Console.WriteLine("");
int userAge = Convert.ToInt32(Console.ReadLine());
if (userAge >= 18)
{
Console.WriteLine("");
int userH = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("");
int userW = Convert.ToInt32(Console.ReadLine());
double userHN = (double)userH / 100;
double userBMI = userW / Math.Pow(userHN, 2);
if (userBMI < 16) Console.WriteLine("BMI Index = {0} -----> SEVERE THINNESS", userBMI.ToString("F"));
else if (userBMI >= 16 && userBMI < 17) Console.WriteLine("BMI Index = {0} -----> MODERATE THINNESS", userBMI.ToString("F"));
else if (userBMI >= 17 && userBMI < 18.5) Console.WriteLine("BMI Index = {0} -----> MILD THINNESS", userBMI.ToString("F"));
else if (userBMI >= 18.5 && userBMI < 25) Console.WriteLine("BMI Index = {0} -----> NORMAL", userBMI.ToString("F"));
else if (userBMI >= 25 && userBMI < 30) Console.WriteLine("BMI Index = {0} -----> OVERWEIGHT", userBMI.ToString("F"));
else if (userBMI >= 30 && userBMI < 35) Console.WriteLine("BMI Index = {0} -----> OBESE CLASS I", userBMI.ToString("F"));
else if (userBMI >= 35 && userBMI < 40) Console.WriteLine("BMI Index = {0} -----> OBESE CLASS II", userBMI.ToString("F"));
else if (userBMI >= 40) Console.WriteLine("BMI index = {0} -----> OBESE CLASS III", userBMI.ToString("F"));
}
else
{
Console.WriteLine("Unfortunately this is not for you. You must be 18 or more.");
Console.ReadKey();
}
Console.WriteLine("\n\n\n------------------------------\n\nPlease upvote if you like\n\n\n");
}
}
}
2. BMI Calculator by Julian Aung
Made by Julian Aung. Source
Your height :1.6 Your weight :60 Your BMI is:23.4375 You're Overweight.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
//Enter your height in meters
//Enter your weight in kilograms
double height;
double weight;
double bmi;
height = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Your height :{0}", height);
weight = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Your weight :{0}", weight);
bmi = weight / (height * height);
Console.WriteLine("Your BMI is:{0}", Math.Round(bmi, 4));
if (bmi < 18.5)
Console.WriteLine("You're underweight.");
else if (bmi > 18.5 && bmi < 23)
Console.WriteLine("You're normal weight.");
else if (bmi > 23)
Console.WriteLine("You're Overweight.");
}
}
}
3. BMI Calculator by artegoser
Made by artegoser. Source
Enter your weight 55 Enter your height 160 Your bmi is: 21.484375
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMICHECKERARTEGOSER
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, I'm a robot for calculating body mass index!");
Console.WriteLine("Enter your weight");
//Вес вводите в килограммах
//Например 65
double m = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(m);
Console.WriteLine("Enter your height");
//Рост вводите в сантиметрах
double h = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(h);
Console.WriteLine("Your bmi is:");
double i = Convert.ToDouble(m / ((h/100) * (h/100)));
Console.WriteLine(i);
if (i <= 16)
{
Console.WriteLine("you have a pronouncent underweight ");
}
if (i >= 40)
{
Console.WriteLine("you have third degree obesity");
}
Console.WriteLine("BMI TABLE:");
Console.WriteLine("16 and less:Pronouncent underweight");
Console.WriteLine("16-18.5: Underweight");
Console.WriteLine("18.5-25: Normal BMI");
Console.WriteLine("25-30: Overweight");
Console.WriteLine("30-35: First degree obesity");
Console.WriteLine("35-40: Second degree obesity");
Console.WriteLine("40 and more: Third degree obesity");
}
}
}
4. BMI Calculator by Kathi
Made by Kathi. Source
1.6 50 Congratulation. You have your normal weight with an BMI of 19.53.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
//please copy it into Visual Studio
//in the first gap you have to put in your high. In the secon your weight.
double size, Weight, bmi, differnce, norm;
//Console.WriteLine("How tall are you?(Entry in meters)");
size = Convert.ToDouble(Console.ReadLine());
//Console.WriteLine("Please enter your weight.(entry in kilogram)");
Weight = Convert.ToDouble(Console.ReadLine());
bmi = Weight / (size * size );
if (bmi >= 30)
{
Console.WriteLine($"Your BMI is {bmi:f2}. Thats means, that you're obese.");
norm = 25 * size*size;
differnce = Weight-norm;
Console.WriteLine($"Your normal weight is {norm:f2}kg. You have to lose {differnce:f2}kg to get your normal weight.");
}
if (bmi >= 25 && bmi < 30)
{
Console.WriteLine($"Your BMI is {bmi:f2}. That's means, that you're pre-obese.");
norm = 25 * size* size;
differnce = Weight - norm;
Console.WriteLine($"Your normal weight is {norm:f2}kg. You have to lose {differnce:f2}kg to get your normal weight.");
}
if (bmi >= 18.5 && bmi <= 25)
{
Console.WriteLine($"Congratulation. You have your normal weight with an BMI of {bmi:f2}.");
}
if (bmi < 15.5)
{
Console.WriteLine($"Your BMI is {bmi:f2}. That's means, that you're underweight.");
norm = 25 * size * size;
differnce = norm-Weight;
Console.WriteLine($"Your normal weight is {norm:f2}kg. You have to increase {differnce:f2}kg to get your normal weight.");
}
}
}
}
5. BMI Calculator by Gek Nub
Made by Gek Nub. Source
Height : 1.6 Weight : 50 19.53125
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
double height = Convert.ToDouble(Console.ReadLine());
double mass = Convert.ToDouble(Console.ReadLine());
double h_squared = (height * height);
double output = (mass / h_squared);
Console.Write(output);
}
}
}
6. BMI Calculator by Bear
Made by Bear. Source
Weight LBS : 120 Height INCH : 5.5 13.7788 Underweight
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
/*
Created by:
*+* Bear *+*
This is the BMI calculator for the code coach in "Python for Beginners."
I converted it into C#
The python version is at the bottom, as a comment.
Enjoy!
*/
double weightLBS = Convert.ToDouble(Console.Read());
double heightIN = Convert.ToDouble(Console.Read());
double BMI = Convert.ToDouble(weightLBS/(heightIN*heightIN)*703);
Console.WriteLine(BMI);
if (BMI < 18.5)
{
Console.WriteLine("Underweight");
}
else if (18.5 <= BMI && BMI < 25)
{
Console.WriteLine("Normal");
}
else if (25 <= BMI && BMI < 30)
{
Console.WriteLine("Overweight");
}
else if (30 <= BMI)
{
Console.WriteLine("Obesity");
}
}
}
}
7. C Sharp BMI Calculator by Sebastian
Made by Sebastian. Source
160 60 Your BMI: 23.4375 | |X| | | | | ^ optimal
/*
⚠ INPUT:
Height (cm)
Weight (kg)
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
float height = GetFloat(170);
float weight = GetFloat(65);
Console.Write("Your BMI: ");
Console.WriteLine(BMI.Calculate(height, weight));
Console.WriteLine();
BMI.DrawChart(BMI.Type(BMI.Calculate(height, weight)));
}
static float GetFloat(float def)
{
try
{ return float.Parse(Console.ReadLine());}
catch { Console.WriteLine("Wrong input -> default value " + def);
return def;}
}
}
class BMI
{
public static float Calculate(float cm, float kg) {
return kg / (cm * cm / 10000);
}
public static int Type(float bmi)
{
if (bmi < 15F)
return 0;
for (int i = 25; i != 40; i +=5)
{
if (bmi < i)
return i / 5 - 4;
}
return 5;
}
public static void DrawChart(int type)
{
Console.Write("|");
for (int i = 0; i != 6; i++)
{
if (i == type)
Console.Write("X");
else Console.Write(" ");
Console.Write("|");
}
Console.WriteLine();
Console.WriteLine(" ^");
Console.WriteLine("optimal");
}
}
}