Factorials: In this program we are going to be print
factorial of a given number. Factorial is represented using '!', so five
factorial will be written as (5!), n factorial as (n!).
Also n! = n*(n-1)*(n-2)*(n-3)...3.2.1 and zero factorial is defined as one i.e. 0! =
1.
This program takes an integer from a user. If user enters negative integer,
this program will display error message and if user enters non-negative
integer, this program will display the factorial of that number.
For example user input is 5 then the factorial of a given number is (1*2*3*4*5)
=120
VB Script program will be as shown:-
Out Put Of the Above Program
No comments:
Post a Comment