{"id":4655,"date":"2023-02-06T10:11:26","date_gmt":"2023-02-06T10:11:26","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=4655"},"modified":"2023-02-06T10:11:27","modified_gmt":"2023-02-06T10:11:27","slug":"convert-fahrenheit-to-celsius-in-c-program","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/convert-fahrenheit-to-celsius-in-c-program\/","title":{"rendered":"convert Fahrenheit to celsius in C program"},"content":{"rendered":"\n<p class=\"has-text-align-center\">convert Fahrenheit to celsius in C program<\/p>\n\n\n\n<p>In this program, we are going to discuss how to convert temperature from Fahrenheit to Celcius.<\/p>\n\n\n\n<p>So let&#8217;s start!<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"youtube-embed\" data-video_id=\"VpigXarV1i4\"><iframe loading=\"lazy\" title=\"Convert Temperature from Fahrenheit to Celsius in C\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/VpigXarV1i4?feature=oembed&#038;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">For Example &#8211;<\/h4>\n\n\n\n<p><strong>Input:<\/strong><\/p>\n\n\n\n<p>For example, we are taking the user input in form of temperature so,<\/p>\n\n\n\n<p>Enter the temperature :<\/p>\n\n\n\n<p>so we are taking the temperature as 100.<\/p>\n\n\n\n<p><strong>Logic:<\/strong><\/p>\n\n\n\n<p>If you want to convert Fahrenheit to celsius then we have to use a formula for this conversion, so we are going to use the formula as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td> Celsius = (fehrenheit \u2013 32) *5\/9<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This is the main logic we going to use in this program so let&#8217;s implement this format in our program.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Output :<\/strong><\/h4>\n\n\n\n<p>According to our input, we get an output after converting the temperature from celsius to kelvin<\/p>\n\n\n\n<p>The equivalent temperature is 37.77<\/p>\n\n\n\n<p><span style=\"color: #cc6699;\"><b>\/\/C program to convert temperature from fehrenheit to celcius.<\/b><\/span><\/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>int main(){<br>float Fahrenheit, celsius;<br>printf(&#8220;Enter a temperature:&#8221;);<br>scanf(&#8220;%f&#8221;, &amp;fahrenheit);<br>celsius = (Fahrenheit -32)*5\/9;<br>printf(&#8220;Equivalent temperature is %0.2f&#8221;,celsius);<br>return 0;<br>}<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Output:<\/h4>\n\n\n\n<p>Enter a temperature: of 100<\/p>\n\n\n\n<p>The equivalent temperature is 37.77<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Explanation :<\/h4>\n\n\n\n<p><strong>Step 1:<\/strong> first of all to convert the temperature from Fahrenheit to celsius you have required to float type variable. One is for user input and the other is to calculate the value of celsius. So from the above example, we take two float-type variables that are Fahrenheit and celsius.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong> Apply the formula which is :<\/p>\n\n\n\n<p>celsius = (Fahrenheit -32) 5\/9<\/p>\n\n\n\n<p><strong>Step 3:<\/strong> After this, we use printf statement to get the output of our program.<\/p>\n\n\n\n<p>So In this way, we simply convert the temperature from Fahrenheit to celsius. I hope this concept is clear to you. You can also explore these examples by putting another value on them. So for now keep exploring and keep learning!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>convert Fahrenheit to celsius in C program In this program, we are going to discuss how to convert temperature from Fahrenheit to Celcius. So let&#8217;s start! For Example &#8211; Input: For example, we are taking the user input in form of temperature so, Enter the temperature : so we are taking the temperature as 100. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[29,111],"class_list":{"0":"post-4655","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-c-program","7":"tag-c-program","8":"tag-convert-fahrenheit-to-celsius-in-c-program"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4655","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=4655"}],"version-history":[{"count":1,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4655\/revisions"}],"predecessor-version":[{"id":4657,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4655\/revisions\/4657"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=4655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=4655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=4655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}