
Write a function that allocates an integer array covering every value between two bounds, in the direction they imply.
int_range(3, 7)Expected result
[3, 4, 5, 6, 7]For your own tracking. Tests grade your code.
int_range(-2, 1)Expected result
[-2, -1, 0, 1]int_range(5, 2)Expected result
[5, 4, 3, 2]int_range(0, 0)Expected result
[0]Expected files
int_range.cAllowed functions
mallocAllowed headers

Write a function that allocates an integer array covering every value between two bounds, in the direction they imply.
int_range(3, 7)Expected result
[3, 4, 5, 6, 7]For your own tracking. Tests grade your code.
int_range(-2, 1)Expected result
[-2, -1, 0, 1]int_range(5, 2)Expected result
[5, 4, 3, 2]int_range(0, 0)Expected result
[0]Expected files
int_range.cAllowed functions
mallocAllowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →