Lab 4.1 - Factorial

Arkangel factorial by Arkangel,

The factorial function, written as n! in math, is where you mulitply all of the whole numbers from 1 to whatever n is. Thus:

Create an application that asks for a number from the user and displays the factorial of that number. Your program should error-check to make sure that the user hasn't entered a negative value.

Here's sample input and answers that you should get:
Input Answer
8 40320
-3 [useful error message]
0 1

HINTS: Use either a Do-Loop-While or a Do-While-Loop (you'll have to figure out which) to run not only the factorial algorithm, but also the error-checking for numbers less than 0. Don't be afraid to add an extra variable if you need one. Use a good sentinel and a variable to keep track of the answer. Factorial numbers get really big, really fast so use a Long instead of an Integer.

Note that your program will crash if you enter an input higher than 20, because the result is too big to fit in a Long variable.