Base conversion in c ?
/* Program to convert from one base to another */ #include <stdio.h> int main(void) { char conversion_values[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; int num, base, converted_base[64], index = 0, index_store ; // Get base and number printf("Enter a number :"); scanf("%d", &num); printf("Enter a base:"); scanf("%d", &base); // Begins do{ converted_base[index] = num % base; index++; num = num / base; }while(num != 0); for (--index; index >= 0; index--){ index_store = converted_base[index]; printf("%d\n", conversion_values[index_store]); } } It returning unpredictable errors Why can anyone help me ?