Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int luythua(int n)
 { int kq=1,i;
   if(n==0) return 1;
   else
    { for(i=1;i<=n;i++)
      { kq *=2;}
    }
   return kq;
 }

int chuyen(char s[20])
 { int kq=0,i,n;
   n=strlen(s)-1;
   if (s[0]=='-'||s[0]=='+')
    { if(s[0]=='-')
      { for(i=n;i>=1;i--)
	kq -= (int)(s[i]-48*luythua(n-1);
      }
      else
      { for(i=n;i>=1;i--)
        kq +=(int)(s[i]-48)*luythua(n-i);
      }
    }
   else
    { for(i=n;i>=0;i--) kq += (s[i]-48)*luythua(n-i);
    }
    return kq;
}

int main
{
 int a;
 char s1[20],s2[20],s[22];
 printf("\n Nhap so thu nhat:");
 scanf("%c",&s1);
 printf("\n Nhap so thu hai:");
 scanf("%c",&s2);
 a=chuyen(s1)+chuyen(s2);
 itoa(a,s,2);
 printf("\n Tong la:")
 itoa(a,s,2);
 return 0;
}