why you are creating a new thread while it is already existing?
your code even not pass the sample input.So how do you expect to get Acc!!!.
Code: Select all
for( i = len-1 ; i >= 0 ; i-- )
{
dec = dec + (input[i]-'0')*(factor-1) ;
factor = factor * 2 ;
}
Code: Select all
input : 20
your output:2
Actual output: 6