# 6+ C Sharp BMI Calculator Programs

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.

## C Sharp BMI Calculator Programs

### 1. BMI Index Calculator

```21
160
50

BMI Index = 19.53 -----> NORMAL```
``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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("");
if (userAge >= 18)
{
Console.WriteLine("");
Console.WriteLine("");

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.");
}

}
}
}``````

### 2. BMI Calculator by Julian Aung

```Your height :1.6
You're Overweight.```
``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
double height;
double weight;
double bmi;
bmi = weight / (height * height);
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

```Enter your weight
55
160
21.484375```
``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BMICHECKERARTEGOSER
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, I'm a robot for calculating body mass index!");
//Вес вводите в килограммах
//Например 65
Console.WriteLine(m);
//Рост вводите в сантиметрах
Console.WriteLine(h);
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

```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;

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)");
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

```Height : 1.6
Weight : 50

19.53125```
``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{

double h_squared = (height * height);
double output = (mass / h_squared);

Console.Write(output);
}
}
}
``````

### 6. BMI Calculator by Bear

```Weight LBS : 120
Height INCH : 5.5

13.7788
Underweight```
``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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 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

```160
60

| |X| | | | |
^
optimal```
``````/*
⚠ INPUT:
Height (cm)
Weight (kg)
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
float height = GetFloat(170);
float weight = GetFloat(65);

Console.WriteLine(BMI.Calculate(height, weight));

Console.WriteLine();
BMI.DrawChart(BMI.Type(BMI.Calculate(height, weight)));
}

static float GetFloat(float def)
{
try
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");
}
}
}
``````