Last active
October 23, 2019 19:03
-
-
Save jgatjens/e43fefca34a3d6c4eb6d40281596b7d4 to your computer and use it in GitHub Desktop.
Revisions
-
jgatjens revised this gist
Oct 23, 2019 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ void test(); char name[20]; int num1, num2, num3, num, i, sum; char pregunta; int main() { @@ -33,9 +33,15 @@ void test() { num = num3; } while(i < num) { sum += i; i++; } printf("nombre: %s \n", name); printf("sumayor: %d \n", num); printf("sumatoria del mayor: %d \n", sum); printf("Desea hacer el la operacion otra ves (y/n):"); scanf("%s", &pregunta); @@ -47,4 +53,3 @@ void test() { } } -
jgatjens created this gist
Oct 23, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ #include<stdio.h> void test(); char name[20]; int num1, num2, num3, num; char pregunta; int main() { test(); return 0; } void test() { printf("name:"); scanf("%s", name); printf("numero 1:"); scanf("%d", &num1); printf("numero 2:"); scanf("%d", &num2); printf("numero 3:"); scanf("%d", &num3); if (num1 > num2 && num1 > num3) { num = num1; } else if (num2 > num1 && num2 > num3) { num = num2; } else { num = num3; } printf("nombre: %s \n", name); printf("mayor: %d \n", num); printf("Desea hacer el la operacion otra ves (y/n):"); scanf("%s", &pregunta); if (pregunta == 'y') { test(); } else { printf("\n\n===> gracias por preferisnos !!\n\n"); } }