Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define max 15
- int lineal(char elementos[], char elebus)
- {
- int i = 0;
- for(i=0; i<max; i++)
- {
- if(strcmp(elementos[i], elebus)==0)
- {
- printf("Elemento encontrado en %d,", i); //element found in
- }
- else
- {
- printf("elemento no encontrado"); //not found
- }
- }
- }
- int main()
- {
- char elebus[50];
- char elementos[max][50]= {"Panque", "Pastel", "Gelatina", "Leche", "Totis", "Tamarindo" "Papas", "Duraznos", "Cacahuates", "Flan", "Pan", "Yogurt", "Café", "Donas", "Waffles"};
- printf("Escribir elemento a buscarn");
- scanf("%s", elebus);
- int lineal(char elementos[], char elebus);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement