
{"id":15925,"date":"2014-08-21T20:52:36","date_gmt":"2014-08-21T20:52:36","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=15925"},"modified":"2014-08-21T20:52:36","modified_gmt":"2014-08-21T20:52:36","slug":"how-to-write-an-algorithm-to-find-factorial-of-a-number","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2014\/08\/21\/how-to-write-an-algorithm-to-find-factorial-of-a-number\/","title":{"rendered":"How to write an algorithm to find factorial of a given number ?"},"content":{"rendered":"<pre>\n#include &lt;stdio.h&gt;\n\nfactorial()\n{\n\nint p = 1;\nint i = 1;\nint n;\nprintf(\"Enter a Number greater than 0 \\n\");\nscanf(\"%d\",&amp;n);\nwhile ( i &lt;= n)\n{\np = p * i;\ni = i + 1;\n}\n\nprintf(\"Factorial of the input is %d \\n\",p);\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#include &lt;stdio.h&gt; factorial() { int p = 1; int i = 1; int n; printf(&#8220;Enter a Number greater than 0 \\n&#8221;); scanf(&#8220;%d&#8221;,&amp;n); while ( i &lt;= n) { p = p * i; i = i + 1; } printf(&#8220;Factorial of the input is %d \\n&#8221;,p); }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[141,78,91],"tags":[748],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15925"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=15925"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15925\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=15925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=15925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=15925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}