Program to convert between different bases

A small linux command line program that converts between bases
Useage:
Run the program, and enter the unit in one of 4 formats.
Binary: 0bxxxxxxxx
Hex: 0xXX
Octal: 0oXX
Deciaml:XX

Code:

#include <iostream>
#include <string>
#include <readline/readline.h>
 #include <readline/history.h>
 #include <stdlib.h>

 using namespace std;
 void binary(long number) {
         long remainder;

         if(number <= 1) {
                 cout << number;
                 return;
         }

         remainder = number%2;
         binary(number >> 1);
         cout << remainder;
 }

 int main(){
     char numbera[64];
     long number;
     char letter=-1;
     while(1){
         cout << "Enter a number: ";
         while((buf = readline("\n >> "))!=NULL)
         {
             if (strcmp(buf,"quit")==0)
                 break;

             printf("[%s]\n",buf);

             if (buf[0]!=0)
                 add_history(buf);
         }
         strcpy(numbera,buf);
         letter = numbera[1];
         if (letter==-1)
             cout <<"Error"<<endl;
         else if (letter == 'x' | letter == 'X'){
             number=strtol(numbera,NULL,16);
         }
         else if(letter=='o' | letter == 'O'){
             numbera[1]='0';
             cout << numbera<<endl;
             number=strtol(numbera,NULL,8);
         }
         else if(letter=='b' | letter == 'B'){
             numbera[1]='0';
             number=strtol(numbera,NULL,2);
         }
         else{
             number=strtol(numbera,NULL,10);
         }
         cout << "Answer :"<<endl;
         cout << "Hex:\t"<< hex <<number<<endl;
         cout << "Oct:\t"<<oct <<number<<endl;
         cout << "Dec:\t"<<dec <<number<<endl<<"Bin:\t";
         binary(number);
         cout << endl<<endl<<endl;
     }
     free(buf);
     return 0;
 }