[ create a new paste ] login | about

Link: http://codepad.org/OJ9bWSgT    [ raw code | output | 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
#include <stdio.h>
#define size 5

int main(){
   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:
1
2
3
4
5
6
In function 'main':
Line 7: error: 'i' undeclared (first use in this function)
Line 7: error: (Each undeclared identifier is reported only once
Line 7: error: for each function it appears in.)
Line 8: error: 'j' undeclared (first use in this function)
Line 10: error: 'tmp' undeclared (first use in this function)


Create a new paste based on this one


Comments: