From e1249c63795e60f01dd4493f752ced9f67ab33c6 Mon Sep 17 00:00:00 2001 From: kmazouzi Date: Tue, 22 Mar 2016 20:04:19 +0100 Subject: [PATCH] add debug lab2 --- lab2/factorial.c | 13 +++++++++++++ lab2/printArray.c | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 lab2/factorial.c create mode 100644 lab2/printArray.c 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