karimsqualli96

exo - help

Jun 14th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define ARR_SIZE   100
  5.  
  6. main()
  7. {
  8.  
  9.    int arr[ARR_SIZE], i;
  10.    int n;
  11.    
  12.    printf("entrer la valeur de n : ");
  13.    scanf("%d", &n);
  14.    
  15.    if(n > ARR_SIZE) {
  16.        fprintf(stderr, "taille trop grande");
  17.        exit(EXIT_FAILURE);
  18.    }
  19.    
  20.    for(i = 0; i < n; ++i)
  21.        scanf("%d", &arr[i]);
  22.      
  23.    for(--i; i >= 0; --i)
  24.        printf("%d ", arr[i]);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment