c-first-steps

a C playground
Index Commits Files Refs README
commit d1cbe5d9bc539cc44a88e186f92533eed2e2245a
parent 943dcb38a71ac8589bee1be30466b76b3bc73048
Author: Martin J. Klöckner <martin.cachari@gmail.com>
Date:   Wed,  2 Dec 2020 11:48:02 -0300

Updated ex01.c

Diffstat:
M95.11/guia05/ex01.c | 18+++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/95.11/guia05/ex01.c b/95.11/guia05/ex01.c
@@ -1,22 +1,18 @@
 #include <stdio.h>
 
-unsigned long fact (int num);
-
-int main ( void ) {
-
-    printf("%lu\n", fact(5));
-
-    return 0;
-}
-
-unsigned long fact (int num) {
+unsigned long fact ( int num ) {
     unsigned long j, res;
     res = 1;
 
     for (j = 1; j <= num; j++) {
         res = (res * j);
     }
-
     return res;
 }
 
+int main ( void ) {
+
+    printf("%lu\n", fact(5));
+
+    return 0;
+}