-1
int main(int argc, char** argv) {
    
    int dizi[8]={2,3,5,4,6,7,1,8},hold=9999;
    
    for(int i=0;i<8;i++){
        for(int a=0;a<8;a++){
        if(dizi[a]<hold)
            hold=dizi[a];
    }
            cout<<hold<<" ";
            for(int b=0;b<8;b++){
            if(dizi[b]==hold){
                dizi[b]=999;
            }
        }
    }
}

i want to sort an array smallest to largest but i can't change the value inside of array. Help?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.