Menu
Coddy logo textTech

Number to Array

Lesson 17 of 20 in Coddy's Beginner Challenges - Practice Basic Concepts course.

challenge icon

Challenge

Easy

Write 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
}

All lessons in Beginner Challenges - Practice Basic Concepts