{"id":43,"date":"2021-10-31T14:52:00","date_gmt":"2021-10-31T14:52:00","guid":{"rendered":"https:\/\/rijankc.com.np\/2021\/10\/31\/wap-to-find-the-factorial-of-a-given-number\/"},"modified":"2024-11-04T09:31:12","modified_gmt":"2024-11-04T03:46:12","slug":"wap-to-find-the-factorial-of-a-given-number","status":"publish","type":"post","link":"https:\/\/rijankc.com.np\/?p=43","title":{"rendered":"WAP to find the Factorial of a given number"},"content":{"rendered":"<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><b>Question:<br \/>\nWrite a program to find the factorial of a given number. <\/b><\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\">\u00a0<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><b>Ans:<\/b><\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>INPUT &#8220;Enter the number :::&#8221; ; n<br \/>\n<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>f = 1<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>For i <span style=\"mso-spacerun: yes;\">\u00a0<\/span>= 1 TO n<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>f = f * i<\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>NEXT I <\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>PRINT &#8220;Factorial of the given number = &#8221; ; f <\/span><\/p>\n<p style=\"line-height: normal; text-indent: -.25in; margin: 0in 0in 0in .25in;\"><span style=\"font-family: 'Times New Roman','serif'; mso-bidi-font-size: 11.0pt;\"><span style=\"mso-tab-count: 1;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>END<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Write a program to find the factorial of a given number. \u00a0 Ans: \u00a0\u00a0\u00a0\u00a0\u00a0&#8230;<\/p>\n","protected":false},"author":1,"featured_media":735,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[115,114],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","category-wap"],"aioseo_notices":[],"featured_image_urls":{"full":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"thumbnail":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial-150x150.png",150,150,true],"medium":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial-300x200.png",300,200,true],"medium_large":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"large":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"1536x1536":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"2048x2048":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"covernews-featured":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false],"covernews-medium":["https:\/\/rijankc.com.np\/wp-content\/uploads\/2021\/10\/factorial.png",500,333,false]},"author_info":{"info":["Admin"]},"category_info":"<a href=\"https:\/\/rijankc.com.np\/?cat=115\" rel=\"category\">C Programming<\/a> <a href=\"https:\/\/rijankc.com.np\/?cat=114\" rel=\"category\">WAP<\/a>","tag_info":"WAP","comment_count":"0","_links":{"self":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":2,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":419,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions\/419"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=\/wp\/v2\/media\/735"}],"wp:attachment":[{"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rijankc.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}