#include <stdio.h>

#include <conio.h>

int main()

{

int A[ 8 ]={ 32 , 51 , 27 , 85 , 66 , 23 , 13 , 57 } ; // A=array

int K , n , b , p=8 ; //p=no of elements in array , n=counter , b=counter ,K is used for swaping

for( n = 0 ; n < p – 1 ; n++ )

{

for( b = 0 ; b < p – n – 1 ; b++)

{

if( A[b] > A[b+1])

{

K = A[ b ] ;

A[ b ] = A[ b + 1 ] ;

A[ b + 1 ] = K ;

}

}

}

for( n = 0 ; n < p ; n++ )

{

printf( “%d\n” , A[n] ) ;

}

getch() ;

return 0 ;

}