C solution
\nchar * convertToBase7(int num){\n    if(num == 0) return "0";\n    char * result = (char *)malloc(12*sizeof(char));\n    int count = 0;\n    bool checkNeg = n
```\nchar * convertToBase7(int num){\n    if(num == 0) return "0";\n    char * result = (char *)malloc(12*sizeof(char));\n    int count = 0;\n    bool checkNeg = num < 0 ? true : false;\n    if(num < 0) num = abs(num);\n    while(num > 0)\n    { \n        result[count++] = num % 7 + \'0\';\n        num /= 7;\n    }\n    if(checkNeg) result[count++] = \'-\';\n    for(int i=0; i<count/2; i++)\n    {\n        int temp = result[i];\n        result[i] = result[count-i-1];\n        result[count-i-1] = temp;\n    }\n    result[count] = 0;\n    return result;\n}\n```
['C']