Skip to content

Instantly share code, notes, and snippets.

@pepgonzalez
Created March 6, 2012 13:48
Show Gist options
  • Save pepgonzalez/1986362 to your computer and use it in GitHub Desktop.
Save pepgonzalez/1986362 to your computer and use it in GitHub Desktop.
#include<stdio.h>
main()
{
int Arr[10];
int num, i, cont = 0;
for (i=0; i<11; i++)
{
printf("Ingrese el elemento %d del arreglo:", i);
scanf("%d", &Arr[i]);
}
printf("\n\n Ingrese el numero que se va a buscar en el arreglo:");
scanf("%d", &num);
for (i=0; i<11; i++)
{
if (Arr[i] == num) {
cont++;
}
}
printf("\n\n El numero %d aparece %d veces", num, cont);
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment