the following is your code with a few adjustments. I only tested the case that you see in set, but I think its correct (famous last words).
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
//assume the array is 5 numbers in size
int set[] = { 6,12,1,8,0 };
int temp = 0;
for( int a = 0; a < 5; a++ )
{
for( int i=4; i >= a; i-- )
{
if( set[i] < set[i-1] )
{
temp = set[i-1];
set[i-1] = set[i];
set[i] = temp;
}
}
}
cout << set[0] << " " << set[1] << " " << set[2] << " " << set[3] << " " << set[4] << endl;
return 0;
}