{"id":808,"date":"2021-11-01T16:00:40","date_gmt":"2021-11-01T16:00:40","guid":{"rendered":"https:\/\/ethosspace.com\/programmers\/?p=808"},"modified":"2023-05-23T08:29:23","modified_gmt":"2023-05-23T08:29:23","slug":"c-program-to-calculate-body-mass-index-bmi","status":"publish","type":"post","link":"https:\/\/ethosspace.com\/programmers\/c-program-to-calculate-body-mass-index-bmi\/","title":{"rendered":"C Program to calculate total Body Mass Index BMI with weight and height"},"content":{"rendered":"\n<p>Body Mass Index is a simple calculation using a person&#8217;s height and weight. To calculate BMI we can use the formula BMI = kg\/m2&nbsp;where kg is a person&#8217;s weight in kilograms and m2&nbsp;is their height in meters squared. Here is a complete C program code to calculate BMI in float value with 2 decimal places.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-c\" data-lang=\"C\"><code>\/* C Program to print BMI based on formula *\/\n#include &lt;stdio.h&gt;\nint main()\n{\n    float wt,ht,bmi;\n    printf(&quot;\\n\\t Enter Weight In Kg\\t&quot;);\n    scanf(&quot;%f&quot;,&wt);\n    printf(&quot;\\n\\t Enter height In Meters\\t&quot;);\n    scanf(&quot;%f&quot;,&ht);\n    \/\/Calculate BMI \n    bmi = wt \/ (ht*ht);\n    if (bmi &lt;= 18.5)\n    {\n        printf (&quot;BMI Report is : %.2f -&gt; Underweight&quot;, bmi);\n    }else if(bmi &lt;= 24.9)\n    {\n        printf(&quot;BMI Report is :  %.2f -&gt; Normal&quot;,bmi);\n    }\n    else if(bmi &gt;= 25 && bmi &lt;= 29.9)\n    {\n        printf(&quot;BMI Report is : %.2f -&gt; Overweight&quot;,bmi);\n    }\nelse\n   printf(&quot;BMI Report is : %.2f -&gt; Obese&quot;,bmi);   \n    return 0;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong> after after calculating body mass index using c program is below<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Enter Weight In Kg\t70\nEnter height In Meters\t2\nBMI Report is : 17.50 -&gt; Underweight<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Body Mass Index is a simple calculation using a person&#8217;s height and weight. To calculate BMI we can use the formula BMI = kg\/m2&nbsp;where kg is a person&#8217;s weight in kilograms and m2&nbsp;is their height in meters squared. Here is a complete C program code to calculate BMI in float value with 2 decimal places. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-808","post","type-post","status-publish","format-standard","hentry","category-c-language"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"sparkling-featured":false,"sparkling-featured-fullwidth":false,"tab-small":false},"uagb_author_info":{"display_name":"program45_-rt8nb","author_link":"https:\/\/ethosspace.com\/programmers\/author\/program45_-rt8nb\/"},"uagb_comment_info":8,"uagb_excerpt":"Body Mass Index is a simple calculation using a person&#8217;s height and weight. To calculate BMI we can use the formula BMI = kg\/m2&nbsp;where kg is a person&#8217;s weight in kilograms and m2&nbsp;is their height in meters squared. Here is a complete C program code to calculate BMI in float value with 2 decimal places.&hellip;","_links":{"self":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/comments?post=808"}],"version-history":[{"count":8,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":1400,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/808\/revisions\/1400"}],"wp:attachment":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/media?parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/categories?post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/tags?post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}