char * convertToTitle(int n){ char* arr = (char*)calloc(1002, sizeof(char)); int val,pst=1001; while (n){ val = n % 26; if (val == 0) val = 26; arr[--pst] = 'A' + val - 1; n = (n-val)/26; } return arr+pst; }