c-first-steps

a C playground
Index Commits Files Refs README
commit 86664e3dfb3f8dc5328014473591e991de8d72ca
parent c67e069e5d5b00bd7e66660a556bf403d3a0c433
Author: Martin J. Klöckner <64109770+klewer-martin@users.noreply.github.com>
Date:   Tue, 27 Oct 2020 08:52:41 -0300

Update factorial.c
Diffstat:
Mfactorial.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/factorial.c b/factorial.c
@@ -1,3 +1,5 @@
+/*    Calculates the factorial of a given number.    */
+
 #include <stdio.h>
 
 int main(void) {
@@ -5,7 +7,7 @@ int main(void) {
     int fact, i, res;
 
     printf("Ingrese un numero: ");
-    scanf("%i", &fact);
+    scanf("%i", &fact);            // future update, delete this unsecure function 
 
     if(fact < 0) {
         printf("Numero invalido\n");