
Write a function that reports whether the first n values of a are in ascending order, where two equal neighbours still count as ordered.
const int a[] = {1, 2, 2, 5}; is_sorted(a, 4);1const int a[] = {4, 1, 9}; is_sorted(a, 3);0const int a[] = {7}; is_sorted(a, 0);1const int a[] = {INT_MIN, INT_MAX}; is_sorted(a, 2);1is_sorted.c<stddef.h>defines size_t
Run the tests to grade your code
Write a function that reports whether the first n values of a are in ascending order, where two equal neighbours still count as ordered.
const int a[] = {1, 2, 2, 5}; is_sorted(a, 4);1const int a[] = {4, 1, 9}; is_sorted(a, 3);0const int a[] = {7}; is_sorted(a, 0);1const int a[] = {INT_MIN, INT_MAX}; is_sorted(a, 2);1is_sorted.c<stddef.h>defines size_t
Run the tests to grade your code
Memory will appear here