
Implement a function that reverses the order of the first n elements of an integer array in place, without allocating a second array.
int a[] = {1, 2, 3}; reverse_int(a, 3);Expected result
3 2 1For your own tracking. Tests grade your code.
int a[] = {1, 2, 3, 4, 5}; reverse_int(a, 3);Expected result
3 2 1 4 5int a[] = {7, 8, 9}; reverse_int(a, 0);Expected result
7 8 9Expected files
reverse_int.cAllowed functions
None. Write every helper yourself.
Allowed headers

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement a function that reverses the order of the first n elements of an integer array in place, without allocating a second array.
int a[] = {1, 2, 3}; reverse_int(a, 3);Expected result
3 2 1For your own tracking. Tests grade your code.
int a[] = {1, 2, 3, 4, 5}; reverse_int(a, 3);Expected result
3 2 1 4 5int a[] = {7, 8, 9}; reverse_int(a, 0);Expected result
7 8 9Expected files
reverse_int.cAllowed functions
None. Write every helper yourself.
Allowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.