Prof_Carvalho icon

Untitled

Prof_Carvalho | PRO | 12/17/19 09:24:05 PM UTC | 0 ⭐ | 245 👁️ | Never ⏰ | []
C |

310 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <stdlib.h>
 
int main(){
    int vet[] = {4,-2,1,2};
    int i, trocado;
    do{
        trocado = 0;
        for(i = 0; i < 2; i++)
            if(vet[i] < vet[i+1]){
                int segura = vet[i];
                vet[i] = vet[i+1];
                vet[i+1] = segura;
                trocado = 1;
            }
    } while(trocado == 1);
    return 0;
 
}

Comments