[ create a new paste ] login | about

Link: http://codepad.org/xoXpEHwQ    [ raw code | fork ]

C, pasted on Jul 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#define size 5

int main(){
   int i,j,tmp;
   int arr[5]={5,1,4,3,2};
   
    for(i=0;i<size;i++){
         for(j=0;j<size-i-1;j++){
              if(arr[i]<arr[j]){
          tmp= arr[i];
          arr[i]= arr[j];
          arr[j]= tmp;

}
              
         }

}
 return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: