/*This program uses move to front search to find givven number from the givven array written by Sadi Evren SEKER*/ #include #define m 10 /*--- m is a constant and can be changed for different problems---*/ int search(int i); /*--- decleration of my searc function ---*/ int a[m]={3,4,1,2,54,23,12,-43,13,45}; /*--- initial array for search function it can be changed for other problems ---*/ void main() { int i; char x; x=110; while(x) { printf("You can search one of the following numbers , is seperator\n\n"); for (i=0;i"); /*--- inputs shoise ---*/ scanf("%d",&i); printf("\n\nYour number is in %d. order (0 means not found)\n",search(i)); printf("\n\nThe final position of array is :\n\n"); for (i=0;i0;k--) a[k]=a[k-1]; a[0]=i; return j+1; } } return 0; /*--- if you cannot find return 0 ---*/ }