{"id":4073,"date":"2022-11-14T10:58:31","date_gmt":"2022-11-14T10:58:31","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=4073"},"modified":"2022-11-14T10:58:34","modified_gmt":"2022-11-14T10:58:34","slug":"c-program-to-convert-centimeters-to-meter","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/c-program-to-convert-centimeters-to-meter\/","title":{"rendered":"C Program to Convert Centimeters to Meter"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><strong>Centimeter to Meter conversion C program<\/strong><\/p>\n\n\n\n<p>In this article, we are going to discuss how to convert centimeters to meters in the c Program. So let&#8217;s start!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C Program to Convert Centimeters to Meter<\/h2>\n\n\n\n<p>For example-<\/p>\n\n\n\n<p><strong>Input-<\/strong><\/p>\n\n\n\n<p>So first step is we are going to take user input in it so that we take input as the length in centimeters which is 22.3<\/p>\n\n\n\n<p><strong>logic-<\/strong><\/p>\n\n\n\n<p>Before starting the program we have to know the formula to convert centimeters to meters and the formula is :<\/p>\n\n\n\n<p>Meter = (cm)\/ 100<\/p>\n\n\n\n<p><strong>Output-<\/strong><\/p>\n\n\n\n<p>According to our input, we get output as<br>Enter the length in cm:22.3<br>The value in meters is 0.223000<\/p>\n\n\n\n<p>So let&#8217;s start to implement this formula in our program. before starting our program we see two examples in the first example we simply use the formula and in the second example, by using a user-defined function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">C Program to Convert Centimeter to Meter Example<\/h3>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background\">\/\/C program to convert the value from centimeter to meter.<br>#include&lt;stdio.h&gt;<br>int main(){<br>float cm, m ;<br>printf(&#8220;Enter the length in cm :&#8221;);<br>scanf(&#8220;%f&#8221;, &amp;cm);<br>m = cm \/100;<br>printf(&#8220;The value in meters is %f&#8221;, m);<br>return 0;<br>}<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background\">Output<br>Enter the length in cm:22.3<br>The value in meters is 0.223000<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Step 1: First we take two float-type variables one is to take input from the user in the form of cm and another for formula which is meter.<\/li>\n\n\n\n<li>Step 2: Now as the next step we use scanf() to store the value of a variable.<\/li>\n\n\n\n<li>Step 3: After this, we simply use the formula. We can see this from the above example.<\/li>\n\n\n\n<li>Step 4: After the above steps we simply use printf() to get our output.<\/li>\n<\/ul>\n\n\n\n<p>Example 2 &#8211;<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background\">\/\/ C program to convert the value from centimeter to meter.<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background\">#include&lt;stdio.h&gt;<br>float meter(float centimeter){<br>return centimeter\/100;<br>}<br>int main(){<br>float centimeter, c;<br>printf(&#8220;Enter the value in centimeter&#8221;);<br>scanf(&#8220;%f&#8221;, &amp;centimeter);<br>c =meter(centimeter);<br>printf(&#8220;The value in meter is %f&#8221;, c);<br>return 0;<br>}<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background\">Output<br>Enter the value in centimeters 22.3<br>The value in meters is 0.223000<\/p>\n\n\n\n<p>In this way, we simply understand how to convert meters to centimeters. I hope these things are clear to you. So for now keep learning and keep exploring!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Centimeter to Meter conversion C program In this article, we are going to discuss how to convert centimeters to meters in the c Program. So let&#8217;s start! C Program to Convert Centimeters to Meter For example- Input- So first step is we are going to take user input in it so that we take input [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[29],"class_list":{"0":"post-4073","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-uncategorized","7":"tag-c-program"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=4073"}],"version-history":[{"count":1,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4073\/revisions"}],"predecessor-version":[{"id":4074,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4073\/revisions\/4074"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=4073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=4073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=4073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}