Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 12, 2018 03:47
Show Gist options
  • Save parzibyte/a8cb0dea7d066f6898cdf25f66dcc230 to your computer and use it in GitHub Desktop.
Save parzibyte/a8cb0dea7d066f6898cdf25f66dcc230 to your computer and use it in GitHub Desktop.
#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