void swap(a,b)
        int *a,*b;
{       int c;
        c  =*a;
        *a =*b;
        *b =c;
        return;
} 
main()
{	int count;			/* a counter */
	int sorted;			/* a flag */
	int item[4];
	item[0]=1;item[1]=2;
	item[2]=0;item[3]=3;

	/* print the initial value of the array */
	count = 3;
init_loop:
	printf("item[%d] == %d\n",count,item[count]); 
	count--;
	if (count>=0) {goto init_loop;}

loop:	/* start of a pass through list of items */
	count = 3;	/* sort 4 items in a list */
	sorted = 1;			/* assume sorted */
	printf("\nStarting a new pass:\n");

next:	if(item[count] < item[count-1]){
		swap(item+count,item+(count-1));
		sorted=0;		/* was not sorted */
	}
	printf("item[%d] == %d\n",count,item[count]);
	count--;
	if(count > 0){ goto next;}
	printf("item[%d] == %d\n",count,item[count]);
	if(sorted != 1) { goto loop;}
}
