answersLogoWhite

0

for($rval = $n = intval($_GET['number']); $n > 2; $n--) $rval *= $n - 1;
echo $rval;

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write the Pseudocode to find the factorial of a number?

Pseudo code+factorial


How to you write anu script apple keyboard?

anu scrpit it was difficultme


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 <iostream> using namespace std; int main() { int i, number=0, factorial=1; // User input must be an integer number between 1 and 10 while(number<1 number>10) { cout << "Enter integer number (1-10) = "; cin >> number; } // Calculate the factorial with a FOR loop for(i=1; i<=number; i++) { factorial = factorial*i; } // Output result cout << "Factorial = " << factorial << endl;


How do you write a program to factorial in PHP?

To write a program that calculates the factorial of a number in PHP, you can use a recursive function or an iterative approach. Here’s a simple example using a loop: function factorial($n) { $result = 1; for ($i = 2; $i <= $n; $i++) { $result *= $i; } return $result; } echo factorial(5); // Outputs: 120 This code defines a function that multiplies numbers from 2 up to the given number $n to compute the factorial.


Why we write 1 of the factorial of 0?

simply, any number divided by 0 is 0.


How do you write a program that calculate factorial in javascript?

factorial number Var num= prompt("enter any number "); Var i=1; Var fact=1; for(i=1;i


7 Write a C program to compute the factorial of a number using for loop?

int factorial(int n) { int i; int f=1; for(i=2;i<=n;++i) f*=i; return f; }


Write an algorithm to print the factorial of given number and then draw the flowchart?

write an algorithm to print the factorial of a given number and then draw the flowchart. This looks like someones homework, defiantly someone looking for the easy way. When it comes to programming, the more you do the better you get. Experience counts (making your own mistakes and learning from the mistake).


Write this expression as a factorial 654321?

720


Write the program that display the factorial of a number?

/* gcc -ansi -Wall -Wextra -pedantic -s -static 0.c -o 0 */ #include <stdio.h> int main ( ) { int n , factorial = 1 ; printf ( "enter the value of n\n") ; scanf ( "%i" , & n ) ; while ( n != 0 ) { factorial *= n ; n -- ; } printf ( "The factorial of n is\n%i\n" , factorial ) ; return 0; }


How do you create factorial program in qbasic?

since factorial is for example , the factorial of 5 = 5 (5-1)(5-2)(5-3)(5-4) that means the last number to subtract from 5 is 4 , which is (n-1) ie the factorial of any number is (n-0)(.............)(n-(n-1)) to write this , 5 REM to calculate the factorial of any number 6 DIM fac AS INTEGER LET fac = 1 10 INPUT "enter the number to find its factorial "; a ' variable a 15 FOR b = 0 TO (a-1) 'numbers that will be subtracted from the " a" 20 c= a -b 'each number in the factorial calculation 25 fac = fac * c 'to compute each multiplication in the factorial 30 NEXT b 35 PRINT 'to leave a line 40 PRINT fac 45 END note this due to some unattained raesons works for numbers 0 to 7