{"id":87,"date":"2020-06-29T10:25:04","date_gmt":"2020-06-29T10:25:04","guid":{"rendered":"\/?p=87"},"modified":"2020-06-29T10:25:04","modified_gmt":"2020-06-29T10:25:04","slug":"c-program-to-find-factorial-of-an-integer","status":"publish","type":"post","link":"http:\/\/suryaprakash.com.np\/?p=87","title":{"rendered":"C Program to find factorial of an integer"},"content":{"rendered":"<p>\/\/calculating factorial of number that is n!=n*(n-1)*(n-2)&#8230;..3*2*1<br \/>\n#include&lt;stdio.h&gt;<br \/>\nvoid main()<br \/>\n{<br \/>\nint fact=1,n;<br \/>\nprintf(&#8220;enter the number&#8221;);<br \/>\nscanf(&#8220;%d&#8221;,&amp;n);<br \/>\nwhile(n!=0)<br \/>\n{<br \/>\nfact=fact*n;<br \/>\nn=n-1;<br \/>\n}<br \/>\nprintf(&#8220;the factorial of a number is =%d&#8221;,fact);<br \/>\n}<\/p>\n<p><strong>OUTPUT<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-89\" src=\"\/wp-content\/uploads\/2020\/06\/FACT-300x143.png\" alt=\"\" width=\"300\" height=\"143\" srcset=\"\/wp-content\/uploads\/2020\/06\/FACT-300x143.png 300w, \/wp-content\/uploads\/2020\/06\/FACT.png 460w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Note:-in Dev C++ the size of an integer is 4 byte. So it gives the output of those input whose output is in the range of 0 to 2^(32)-1 for unsigned and -2^32 to (2^32)-1 for signed integer.(since 4 byte=8*4=32 bit)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/calculating factorial of number that is n!=n*(n-1)*(n-2)&#8230;..3*2*1 #include&lt;stdio.h&gt; void main() { int fact=1,n; printf(&#8220;enter the number&#8221;); scanf(&#8220;%d&#8221;,&amp;n); while(n!=0) { fact=fact*n; &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/87"}],"collection":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87"}],"version-history":[{"count":1,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":90,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions\/90"}],"wp:attachment":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}