{"id":4338,"date":"2022-12-12T09:50:07","date_gmt":"2022-12-12T09:50:07","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=4338"},"modified":"2022-12-12T09:58:12","modified_gmt":"2022-12-12T09:58:12","slug":"c-program-to-calculate-volume-of-cube","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/c-program-to-calculate-volume-of-cube\/","title":{"rendered":"C Program To Calculate Volume Of Cube"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><strong>How to Find the Volume of Cube<\/strong><\/p>\n\n\n\n<p>In this program, we are going to discuss how to calculate the volume of a cube, so let&#8217;s start!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C Program To Calculate Volume Of Cube<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The volume of Cube Formula<\/h3>\n\n\n\n<p>Before start to the program, we have to know about the formula of the volume of a cube. So the formula for the volume of a cube is:<\/p>\n\n\n\n<h4 class=\"alignwide has-text-align-center wp-block-heading\">Volume of cube = side * side * side<\/h4>\n\n\n\n<p>So now let&#8217;s see how we can implement these formulas in our program. we can simply calculate the volume of a cube by using this formula.<\/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>{<br>float side ;<br>float volume;<br>printf(&#8220;Enter the side of cube:&#8221;);<br>scanf(&#8220;%f&#8221;,&amp;side);<br>volume = side * side * side;<br>printf(&#8220;The Volume of the cube is %f&#8221;, volume);<br>return 0;<br>}<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<p>Enter the side of cube: 2.2<br>The volume of the cube is 10.648001<\/p>\n\n\n\n<p><strong>Step 1: <\/strong>take two float data type variables. One for user input and another to calculate the volume.<\/p>\n\n\n\n<p><strong>Step 2: <\/strong>apply the formula to calculate the volume of a cube that is :<br>Volume = side * side * side.<\/p>\n\n\n\n<p><strong>Step 3: <\/strong>To print the answer simply use printf statement.<\/p>\n\n\n\n<p><strong>Step 4: <\/strong>Press F9 to run this program.<\/p>\n\n\n\n<p>First, we get a side of the cube from the user by using the side variable, after that, we use scanf to get user input then we simply apply the formula and print the volume of our cube.<\/p>\n\n\n\n<p>So in this way, we can simply find the volume of a cube. I hope this program is helpful for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Find the Volume of Cube In this program, we are going to discuss how to calculate the volume of a cube, so let&#8217;s start! C Program To Calculate Volume Of Cube The volume of Cube Formula Before start to the program, we have to know about the formula of the volume of a [&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,50],"class_list":{"0":"post-4338","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-c-program","7":"tag-c-program","8":"tag-c-program-to-calculate-volume-of-cube"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4338","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=4338"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4338\/revisions"}],"predecessor-version":[{"id":4341,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/4338\/revisions\/4341"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=4338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=4338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=4338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}