answersLogoWhite

0

<html>

<script language="vbscript">

n=cint(inputbox("Enter a number"))

dim f

f=1

if n<0 then

Msgbox "Invalid number"

elseif n=0 or n=1 then

MsgBox "The factorial of given number "&n&" is :"&f

else

for i=n to 2 step -1

f=f*i

next

MsgBox "The factorial of given number "&n&" is :"&f

end if

</script>

</html>

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you find out how many digits are in integer using vbscript?

num=32767 MsgBox(len(num))


By using call by reference find the factorial of a number?

chutia mc,bc bhosdika


Home page containing pull down menu box for the links using vbscript?

Home page containing pull down menu box for the links using VBScript.


Write a java program to find the factorial of a given number?

Here's a simple Java program to find the factorial of a given number using a recursive method: import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(&quot;Enter a number: &quot;); int number = scanner.nextInt(); System.out.println(&quot;Factorial of &quot; + number + &quot; is &quot; + factorial(number)); } static int factorial(int n) { return (n == 0) ? 1 : n * factorial(n - 1); } } This program prompts the user for a number and calculates its factorial recursively.


Write the Pseudocode to find the factorial of a number?

Pseudo code+factorial


When was VBScript created?

VBScript was created in 1996.


Algorithm to find factorial using functions?

factorial using recursion style in c++ is unsigned int fact(unsigned int a) { if (a&lt;=1) return 1; else { f*=fact(a-1); return a; } } when using looping structure factorial is unsigned int fact (unsigned int n) { unsigned int i,f=1; for(i=1;i&lt;=n;i++) f*=i ; return f; }


Program to find n th fabonacci number?

#include #include using std::cin;using std::cout;using std::endl;using std::tolower;long factorial(const int& N);int main(){int N = 0; //factorial of Nchar command = 'n';do{cout > N;cout


How you can find a factorial of a number without using multiple operator?

If you really wanted to do this, you could simulate multiplication with repeated addition.


Factorial of a number in shell?

To calculate the factorial of a number in a shell script, you can use a simple loop. Here's a basic example: #!/bin/bash factorial=1 read -p &quot;Enter a number: &quot; num for (( i=1; i&lt;=num; i++ )) do factorial=$((factorial * i)) done echo &quot;Factorial of $num is $factorial&quot; This script prompts the user for a number, computes its factorial using a for loop, and then prints the result.


A program for simple factorial in prolog?

In Prolog, a simple factorial program can be defined using recursion. Here's a basic implementation: factorial(0, 1). % Base case: factorial of 0 is 1 factorial(N, Result) :- N &gt; 0, N1 is N - 1, factorial(N1, Result1), Result is N * Result1. % Recursive case You can query the factorial of a number by calling factorial(N, Result). where N is the number you want to compute the factorial for.


Flowchart to find factorial of a given no?

Kat