Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Project: Public Code
Views: 852
1
#include <stdio.h>
2
3
int find(int T[], int n, int a) {
4
int i;
5
for(i=0; i< n; i++) {
6
if(T[i] == a) {
7
return 1;
8
}
9
}
10
return 0;
11
}
12
13
14
int main(void) {
15
int T[10] = {2, 3, 5, 8, -5, 9, 0, 4, 1, 12};
16
17
printf("%d\n", find(T,10,5));
18
printf("%d\n", find(T,10,10));
19
20
}
21
22