answersLogoWhite

0

#include<stdio.h> #include<conio.h> main() { int f=1,i=1,n; clrscr(); printf("\n Enter factorial value"); scanf("%d",&n); for(;i<=n;i++) { f=f*i; } printf("\n The factorial value=%d",f); getch(); }

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Write this expression as a factorial 87654321?

That's not the factorial of any number. For a start, the factorial of any number greater than or equal to 2 is even, because of the factor 2. The factorial of any number greater or equal to five ends with 0. Another answer: I suspect the questioner meant to ask how to write 8*7*6*5*4*3*2*1 as a factorial. If so, then the answer is "8!"


Write a recursive procedure to compute the factorial of a number?

#include &lt;iostream&gt; using namespace std; int main() { int i, number=0, factorial=1; // User input must be an integer number between 1 and 10 while(number&lt;1 number&gt;10) { cout &lt;&lt; "Enter integer number (1-10) = "; cin &gt;&gt; number; } // Calculate the factorial with a FOR loop for(i=1; i&lt;=number; i++) { factorial = factorial*i; } // Output result cout &lt;&lt; "Factorial = " &lt;&lt; factorial &lt;&lt; endl;


Programming to calculate a factorial number?

double factorial(double N){double total = 1;while (N > 1){total *= N;N--;}return total; // We are returning the value in variable title total//return factorial;}int main(){double myNumber = 0;cout > myNumber;cout


Write the Pseudocode to find the factorial of a number?

Pseudo code+factorial


How do find factorial using vbscript?

&lt;html&gt; &lt;script language="vbscript"&gt; n=cint(inputbox("Enter a number")) dim f f=1 if n&lt;0 then Msgbox "Invalid number" elseif n=0 or n=1 then MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f else for i=n to 2 step -1 f=f*i next MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f end if &lt;/script&gt; &lt;/html&gt;