Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trocaVetor(int n[]);
- int main()
- {
- int n[20], i;
- setlocale(LC_ALL,"Portuguese");
- for (i=0; i<5; i++){
- printf("%dº: ", i+1);
- scanf("%d", &n[i]);
- }
- trocaVetor(n);
- return 0;
- }
- int trocaVetor(int n[])
- {
- int i, j, c=5, aux=0;
- for (i=0; i<5; i++) {
- for(j=0; j<5; j++){
- aux = n[i];
- n[i] = n[j];
- n[j] = aux;
- }
- printf("\n%dº: %d", i+1, n[i]);
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement