Question: SEE Question 2 Computing factorial Write a C program, named factorial.c, which reads a positive integer n from the command line argument, computes and prints
SEE Question 2 Computing factorial Write a C program, named factorial.c, which reads a positive integer n from the command line argument, computes and prints the factorials i, for i from 1 ton, and ni. Use int type in computing, and use format $11d to print int number and four numbers per line. Your program should be robust for invalid argument input and overflow. The output of different command line arguments should be as shown in the following test. public test gcc factorial.c -o factorial 24 factorial 6 1 120 6!: 720 2 720 factorial 15 1 120 362880 overflow: 131 2 720 3628800 6 5040 39916800 24 40320 479001600 factorial a a: invalid argument
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
