code..

void base_minus2(int n)
{
    int x,y;
    if( n==0 ){
        return ;
    }
    else
    {
        x = n % (-2) ;
        if(n<0 && (n%2!=0)){
            n=n-1;
            x = 1;
        }
        base_minus2(n/(-2));
        printf("%d",x);
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to