Thefaceofbo

Sort Test (C)

Nov 10th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int bubbleSort(int *, int);
  4.  
  5. #include "sort.c"
  6.  
  7. int main(void){
  8.    int len = 5;
  9.    int array[5] = {9,2,8,6,3};
  10.    int r,i;
  11.    r = bubbleSort(array, len);
  12.    for (i=0; i<len; i=i+1){
  13.       printf("%d", array[i]);
  14.       if (i != len-1) {
  15.          printf(",");
  16.       }
  17.    }
  18.    printf("\n");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment