Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sort(){
- int i;
- int j;
- for(i = 0; i < (sizeof(values)/sizeof(values[0])); i++){
- for(j = 0; j < (sizeof(values)/sizeof(values[0])); j++){
- if(values[j] > values[j + 1]){
- swap(&values[j], &values[j + 1]);
- }
- }
- }
- }// end sort
- void swap(int* i, int* j){
- int x = *i;
- *i = *j;
- *j = x;
- }//end swap
- Before:
- 7 3 9 4 6 1 2 8 5
- After:
- 0 1 2 3 4 5 6 7 8
- Process returned 0 (0x0) execution time : 0.016 s
- Press any key to continue.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement