{"id":4726,"date":"2017-10-09T15:14:28","date_gmt":"2017-10-09T15:14:28","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=4726"},"modified":"2021-03-20T12:44:42","modified_gmt":"2021-03-20T12:44:42","slug":"c-program-to-convert-celsius-to-fahrenheit","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/c-program-to-convert-celsius-to-fahrenheit\/","title":{"rendered":"C Program to convert Celsius to Fahrenheit"},"content":{"rendered":"<p>C Program to convert the temperature Celsius to Fahrenheit. It is easier to develop programs using IDE. In this tutorial, we will use Code::Blocks IDE.<\/p>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/download-and-install-codeblocks\/\">https:\/\/www.testingdocs.com\/download-and-install-codeblocks\/<\/a><\/strong><\/p>\n<h3>C Program<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4797\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit.png\" alt=\"Celsius to Fahrenheit\" width=\"1920\" height=\"1118\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit-300x175.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit-1024x596.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit-768x447.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Celsius-to-Fahrenheit-1536x894.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;\r\nint main()\r\n{\r\n    float f,c;\r\n    int choice;\r\n    printf(\"--- Menu ---\\n\");\r\n    printf(\"1. Celsius to Fahrenheit.\\n\");\r\n    printf(\"2. Fahrenheit to Celsius.\\n\");\r\n    printf(\"Enter choice :\");\r\n    scanf(\"%d\",&amp;choice);\r\n    if(choice == 1)\r\n    {\r\n        printf(\"Enter the Temperature in Celsius :\");\r\n        scanf(\"%f\",&amp;c);\r\n        f=(c*9)\/5+32;\r\n        printf(\"Temperature in Fahrenheit is:%.2f\",f);\r\n    }\r\n    else if(choice ==2)\r\n    {\r\n        printf(\"Enter the Temperature in Fahrenheit :\");\r\n        scanf(\"%f\",&amp;f);\r\n        c=(f- 32)*5\/9;\r\n        printf(\"Temperature in Celsius is:%.2f\",c);\r\n    }\r\n    else\r\n    {\r\n        printf(\"INVALID option.\");\r\n    }\r\n    return 0;\r\n}\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4798\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output.png\" alt=\"Program Output\" width=\"1920\" height=\"1082\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output-300x169.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output-1024x577.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output-768x433.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Program-Output-1536x866.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h3>Output<\/h3>\n<p>Menu &#8212;<br \/>\n1. Celsius to Fahrenheit.<br \/>\n2. Fahrenheit to Celsius.<br \/>\nEnter choice :2<br \/>\nEnter the Temperature in Fahrenheit :98.4<br \/>\nTemperature in Celsius is:36.89<\/p>\n<h3><\/h3>\n<h3>Debugging<\/h3>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/debugging-a-c-program-in-codeblocks\/\">https:\/\/www.testingdocs.com\/debugging-a-c-program-in-codeblocks\/<\/a><\/strong><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-4726\" data-postid=\"4726\" class=\"themify_builder_content themify_builder_content-4726 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>C Program to convert the temperature Celsius to Fahrenheit. It is easier to develop programs using IDE. In this tutorial, we will use Code::Blocks IDE. https:\/\/www.testingdocs.com\/download-and-install-codeblocks\/ C Program #include&lt;stdio.h&gt; int main() { float f,c; int choice; printf(&#8220;&#8212; Menu &#8212;\\n&#8221;); printf(&#8220;1. Celsius to Fahrenheit.\\n&#8221;); printf(&#8220;2. Fahrenheit to Celsius.\\n&#8221;); printf(&#8220;Enter choice :&#8221;); scanf(&#8220;%d&#8221;,&amp;choice); if(choice == 1) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[188],"tags":[],"class_list":["post-4726","post","type-post","status-publish","format-standard","hentry","category-c-programs","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=4726"}],"version-history":[{"count":3,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4726\/revisions"}],"predecessor-version":[{"id":19551,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4726\/revisions\/19551"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=4726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=4726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=4726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}