c-first-steps

a C playground
Index Commits Files Refs README
commit 2196d1b2a4a57d46172b500cec7f08a8e96e3f64
parent 4603e70459f1c0294b836284cfd24c94b83d26e5
Author: Martin J. Klöckner <martin.cachari@gmail.com>
Date:   Tue, 27 Oct 2020 10:54:19 -0300

Merge branch 'master' of github.com:klewer-martin/c-repo into master

I don't know what the hell i am doing lol

Diffstat:
Mfactorial.c | 8+++++---
Ahelloworld_w.c | 8++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/factorial.c b/factorial.c
@@ -1,14 +1,16 @@
+/*    Calculates the factorial of a given number.    */
+
 #include <stdio.h>
 
 int main(void) {
     
     int fact, i, res;
 
-    printf("Ingrese un numero: ");
-    scanf("%i", &fact);
+    printf("Enter a number: ");
+    scanf("%i", &fact);            // future update, delete this unsecure function 
 
     if(fact < 0) {
-        printf("Numero invalido\n");
+        printf("Enter a valid number!\n");
         return 1;
     }
 
diff --git a/helloworld_w.c b/helloworld_w.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(void) {
+
+  printf("Hello world!\n");
+
+  return 0;
+}