#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define LENGTH 20
main()
{
CODE
char num[LENGTH];
int i, temp, base10, baseN, j;
printf("Enter a number and baseN:");
scanf("%s%d",&num,baseN);
[/CODE]if( baseN >= 2)[/CODE]{ // ensure the base is larger than 1
CODE
for ( i=0; i<strlen(num)-1; i++)
// check the length of
string, in fact , i don't know why i wirte it
*line14
CODE
temp = num[i]; // change the position of num
num[i] = num[LENGTH]; // same
num[LENGTH]= temp; // same
for ( j=0; j<=strlen(num); i++)
// actually i don't know what
i do
CODE
base10 = 0;
base10 = base10 + ((num[LENGTH] * baseN)+ num[i]+1);
// find
the num of base10
printf("base10 = %d\n",base10);
system("PAUSE");
}
}
At line14, actually i want to eg..
1011(2)-----> 1*2^3+ 0*2^2+ 1*2^1+ 1*2^0---> 1*2^0+ 1*2^1+ 0*2^2+
1*2^3
and for this (((a * X) +

* X) + c
i am not really understand how to write it
can anybody help me to complete the programe