home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_04 / 268.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-12  |  432KB  |  2550x3300
Labels: book | crt screen | reckoner | sky
OCR: 268 Chapter Arrays and Pointers bubble Synopsis Attempts to impi lement bubble sort of an array of intege rs It has small bug i+ Tix the bug Obi iective Gives pract ice in debugg ing. Include Files include <stdio h Functi ion Protot ypes void bubh sort( int[l, int ); void swap int, int ); int main void int index data[10] 10 5,9,7,1,6}; bubble sort( data, 10 for index=0, index 10 index+ pri intf( data index] pri nt \n" return void bubble sort( int datall, int num elts int for num elts; ++T num ts-l; i;j-- data[j] data [1-1] swap( data a[j], data [-1] ); void swap int int int temp; temp awe Fix the bug in the program The array should be sorted when it is output impl ement Objective Incl lude Function printf datail