Number to Array
Lesson 17 of 20 in Coddy's Beginner Challenges - Practice Basic Concepts course.
Challenge
EasyWrite a function named convert that gets a number and returns an array of integers representing this number.
Examples,
convert(123)->[1, 2, 3]convert(91)->[9, 1]
Assume only integers and positive
Try it yourself
#include <stdlib.h>
int* convert(int n, int* returnSize) {
// Write code here
}