Code://Could someone please tell me is my fill an array function and bubble sort function wrong or correct, because when you compile this code the integers are sorted from 1 to 100, but some of them are repeated twice for the same index, why is that? #include<stdio.h> #include<stdlib.h> void fillArray ( int grades [] ); void printArray(int grades[]); void bubbleSort(int grades []); int binarySearch(int grades[],int key); main() { int grades [100] ={0}; int key; fillArray (grades); bubbleSort(grades); printArray(grades); binarySearch(grades,key); system("pause"); } void fillArray ( int grades [] ) { int array [100]; int i; for ( i= 0; i < 100;i ++) { grades[i] = rand() % 100 + 1; } } void printArray(int grades[]) { int i; for(i =0;i < 100;i++) { printf("grade %d is %d\n",i,grades[i]); } } void bubbleSort(int grades []) { int i , x; int temp; for ( x=0; x<100; x++) { for ( i=0; i<100 ; i++) { if (grades[i] > grades[i+1] ) { temp = grades[i]; grades[i] = grades[ i+1]; grades[i+1] = temp; } } } } int binarySearch(int grades[],int key) { int i, start, end, middle; for (start = 0, end = 100-1; start <= end;) { printf ("\nEnter the number you are looking for: "); scanf ("%d",&i); printf("grade %d is %d\n",i,grades[i]); middle= start+(end-start) / 2; } if (grades[middle] > key) { end = middle - 1; } else if (grades[middle] < key) { start = middle + 1; } else { return middle; } return -1; }