#include <stdio.h>
main ()
{
int factorial; /* current factorial value */
int i; /* loop index */
int n; /* loop until n factorial */
/* prompt for max factorial value */
printf ("Enter number of factorials: ");
scanf ("%i", &n);
factorial = 1; /* let's start at 1 */
/* loop from 1 to n */
for (i = 1; i <= n; ++i)
{
/* compute and print each factorial */
factorial *= i;
printf ("\n %i ! = %i", i, factorial);
} /* end for */
return (0);
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cm1haW4gKCkKewogICAgaW50IGZhY3RvcmlhbDsgLyogY3VycmVudCBmYWN0b3JpYWwgdmFsdWUgKi8KICAgIGludCBpOyAgICAgICAgIC8qIGxvb3AgaW5kZXggKi8KICAgIGludCBuOyAgICAgICAgIC8qIGxvb3AgdW50aWwgbiBmYWN0b3JpYWwgKi8KICAgIAogICAgLyogcHJvbXB0IGZvciBtYXggZmFjdG9yaWFsIHZhbHVlICovCiAgICBwcmludGYgKCJFbnRlciBudW1iZXIgb2YgZmFjdG9yaWFsczogIik7CiAgICBzY2FuZiAgKCIlaSIsICZuKTsKICAgIAogICAgZmFjdG9yaWFsID0gMTsgIC8qIGxldCdzIHN0YXJ0IGF0IDEgKi8KCiAgICAvKiBsb29wIGZyb20gMSB0byBuICovCiAgICBmb3IgKGkgPSAxOyBpIDw9IG47ICsraSkKICAgIHsKICAgIAkvKiBjb21wdXRlIGFuZCBwcmludCBlYWNoIGZhY3RvcmlhbCAqLwogICAgCWZhY3RvcmlhbCAqPSBpOwogICAgCXByaW50ZiAoIlxuICVpICEgPSAlaSIsIGksIGZhY3RvcmlhbCk7CiAgICAJCiAgICB9IC8qIGVuZCBmb3IgKi8KCiAgICByZXR1cm4gKDApOwp9Cg==