18/09/16 18:25:50.55 MIF83oNx.net
# include<stdio.h>
# include <stdlib.h>
# define N 10
int a[N + 1], key;
int search(int a[],int key,int i);
int main(int argc, char *argv[])
{
int a[]= {0,1,2,3,4,5,6,7,8,9};
key = atoi(argv[1]);
a[N]=key;
if (search(a, key ,0) < N) {
printf("Found!\n");
}
else{
printf("Not Found!\n");
}
}
int search(int a[], int key, int i)
{
if(a[i]==key){
return i;
}
return search(a,key,++i);
}