Advertisement
fqrmix

Untitled

Oct 28th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(void) {
  3.     int a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  4.     int k;
  5.     for (int i = 0; i < 5; i++) {
  6.         k = *(a+i);
  7.         *(a + i) = *(a + (9 - i));
  8.         *(a + (9 - i)) = k;
  9.     }
  10.     for (int i = 0; i < 10; i++)
  11.         printf("%d ", *(a+i));
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement