Advertisement
jordanov

Untitled

Nov 21st, 2020
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n,i;
  7. scanf("%d",&n);
  8. int niza[n];
  9.  
  10. for(i=0;i<n;i++)
  11. {
  12. scanf("%d",&niza[i]);
  13. printf("%d ",niza[i]);
  14. }
  15.  
  16. printf("\n");
  17.  
  18. //PREVRTUVANJE NA NIZA
  19. for(i=n-1;i>=0;i--){
  20. printf("%d ",niza[i]);
  21. }
  22.  
  23. printf("\n");
  24.  
  25. for(i=n-1;i>=0;i--)
  26. {
  27.  
  28. if(i%2==0){
  29. printf("%d ",niza[i]);
  30. }
  31.  
  32. }
  33.  
  34. printf("\n");
  35.  
  36. for(i=0;i<n;i++){
  37. if(i%2==0){
  38. printf("%d ",niza[i]);
  39. }
  40. }
  41.  
  42. return 0;
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement