Skip to content

Instantly share code, notes, and snippets.

@huseyin
Created April 9, 2019 23:10
Show Gist options
  • Save huseyin/6043756c600ba7982d2f47717f8523c6 to your computer and use it in GitHub Desktop.
Save huseyin/6043756c600ba7982d2f47717f8523c6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#define LENGTH 10
int main(void) {
int numberList[LENGTH] = {4, 7, 3, 2, 8, 0, 1, 5, 9, 6};
int i, number;
int found = 0;
printf("Enter a number: ");
scanf("%d", &number);
for (i = 0; i < LENGTH; i++) {
if (numberList[i] == number) {
found = 1;
break;
}
}
if (found)
printf("The number has found in list. Thanks.\n");
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment