CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Swapping Array Ends

C code walkthrough · Question 29
mediumArrays

Code

Read carefully. What does this print?
1#include <stdio.h>
2int main() {
3 int arr[3] = {1, 2, 3};
4 int temp = arr[0];
5 arr[0] = arr[2];
6 arr[2] = temp;
7 printf("%d %d %d\n", arr[0], arr[1], arr[2]);
8 return 0;
9}

Your answer