Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int main()
- {
- int vet[10];
- int i, j, v;
- printf("Digite uma sequencia de 10 números para compor um vetor \n\n");
- for (i = 0; i<10; i++)
- {
- printf("Digite um numero para compor o vetor:");
- scanf("%d",&vet[i]);
- }
- for (i=0; i<10; i++)
- for(j=i+1; j<10; j++)
- {
- if (vet[i]>vet[j])
- {
- v=vet[i];
- vet[i]=vet[j];
- vet[j]=v;
- }
- }
- for(i=0;i<10;i++)
- printf(" %d",vet[i]);
- printf (" \n");
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment