diff --git a/lab2/factorial.c b/lab2/factorial.c new file mode 100644 index 0000000..3cf7143 --- /dev/null +++ b/lab2/factorial.c @@ -0,0 +1,13 @@ +#include + +int main() +{ + int i, num, j; + printf ("Enter the number: "); + scanf ("%d", &num ); + + for (i=1; i + +// print an array of integers, all on one line. +void printIntArray(int *a, int n) +{ + + int i; // i is a "local variable" inside printIntArray + + // A loop that prints every value in the array + for (i=0; 1