#include #include #include #include #include #include #include #include main() { int array[30],n; clrscr(); n = GetArray(array); BubbleSort(array,n); BinarySer(array,n); getch(); return; } GetArray(array) int *array; { int n,i; do { printf("\nHow many numbers do you want to enter (below 30)\t"); scanf("%d",&n); } while(n<1 || n>30); printf("\nEnter the numbers\t"); for(i=0;i *(array+j+1)) { temp = *(array+j); *(array+j) = *(array+j+1); *(array+j+1) = temp; } printf("\nThe sorted array is\n"); for(i=0;i key) last = mid-1; else if(*(array+mid) < key) first = mid+1; else { loc = mid + 1; found = 1; } } if(found) { printf("\nThe element found in location %d",loc); printf("\nNumber of probes is %d",probe); } else printf("\nThe element not found"); return; }