easy c program
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nchar* convertToBase7(int num) {\n    int sz = 0;\n    char *v = malloc(16);\n\n    int mask = num >> 31;\n    num = (num ^ mask)-mask;\n\tint neg = !!mask;\n    v[sz] = \'-\';\n    sz |= neg; /* sz += 1 */\n    \n    do {\n        v[sz++] = (num % 7) + \'0\'; \n        num /= 7;\n    } while(num);\n\n    for(int i = neg, j = sz - 1; i < j; i++, j--) {\n        char t = v[i];\n        v[i] = v[j];\n        v[j] = t;\n    }   \n    v[sz] = \'\\0\';\n\n    return v;\n}\n```
['C']