Selection sort in C.

01  #include <stdio.h>
02 
03  int main()
04   {
05     int A[20], N, Temp, i, j; 
06     printf(" ENTER THE NUMBER OF TERMS...: ");
07     scanf("%d",&N); 
08     printf("\n ENTER THE ELEMENTS OF THE ARRAY...:"); 
09     
10  for(i=1; i<=N; i++)
11       {
12        scanf("%d", &A[i]); 
13       }
14     for(i=1; i<=N-1; i++)
15     for(j=i+1; j<=N;j++)
16     if(A[i]>A[j]) 
17       {
18        Temp = A[i]; 
19        A[i] = A[j]; 
20        A[j] = Temp; 
21       }
22     printf("THE ASCENDING ORDER LIST IS...:");
23     for(i=1; i<=N; i++)
24     printf("\n%d",A[i]);
25  
26     return 0; 
27   }

 OUTPUT :
 
 ENTER THE NUMBER OF TERMS...: 4
 
 ENTER THE ELEMENTS OF THE ARRAY...:
 
     12
     22
     3
     15
 
 THE ASCENDING ORDER LIST IS...:
 
 3
 12
 15
 22