Created
March 12, 2018 03:47
-
-
Save parzibyte/a8cb0dea7d066f6898cdf25f66dcc230 to your computer and use it in GitHub Desktop.
This file contains 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 characters
#include <stdio.h> | |
int main(){ | |
int numeros[] = {1, 8, 6, 50, 3}; | |
int mayor, menor; | |
mayor = menor = numeros[0]; | |
for (int i = 1; i < sizeof(numeros) / sizeof(numeros[0]); ++i) | |
{ | |
if (numeros[i] > mayor) mayor = numeros[i]; | |
if (numeros[i] < menor) menor = numeros[i]; | |
} | |
printf("El mayor es %d y el menor es %d\n", mayor, menor); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment