Skip to content

Instantly share code, notes, and snippets.

@jgatjens
Last active October 23, 2019 19:03
Show Gist options
  • Save jgatjens/e43fefca34a3d6c4eb6d40281596b7d4 to your computer and use it in GitHub Desktop.
Save jgatjens/e43fefca34a3d6c4eb6d40281596b7d4 to your computer and use it in GitHub Desktop.
test
#include<stdio.h>
void test();
char name[20];
int num1, num2, num3, num, i, sum;
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;
}
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);
if (pregunta == 'y') {
test();
} else {
printf("\n\n===> gracias por preferisnos !!\n\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment