Advertisement
Guest User

Untitled

a guest
May 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6.    int vet[4],Invertido[4];
  7.    int i, x, j;
  8.  
  9.    printf("Introduza 5 numeros:\n");
  10.  
  11.    for (i = 0; i <= 4; i++)
  12.       scanf("%d",&vet[i]);
  13.  
  14.       printf("\nVetor invertido:\n\n");
  15.  
  16.     for (j = 0, x = i-1; x >= 0; x--, j++){
  17.        Invertido[j] = vet[x];
  18.        printf("%d", Invertido[j]);
  19.     }
  20.     printf("\n");
  21.     system("PAUSE");
  22.    
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement