Exemplo n.º 1
0
int main(){
    int tamanho, *vet, i;
    
    scanf("%d", &tamanho);
    vet = (int *) malloc(tamanho *(sizeof (int)));
    for(i=0;i<tamanho;i++){
            scanf("%d", &vet[i]);
    }
    imprime(vet, tamanho);
    bolha(vet, tamanho);
    imprime(vet, tamanho);
    return 0;
}
Exemplo n.º 2
0
int main(){
    int num1 = 10, num2 = 20;
    int vetor[] = {31, 20, 7, 12, 50, 18};

    printf("%d %d %d\n", num1, num2, somar(num1, num2));
    trocar(&num1, &num2);
    printf("%d %d %d\n", num1, num2, somar(num1, num2));

    print_vetor(vetor, 6);
    bolha(vetor, 4);
    print_vetor(vetor, 6);

    return 0;
}