Answer to Question 16A-4

#include <cstdio>
using namespace std;

//=======================================================
//                    WriteInBinary
//=======================================================
// WriteInBinary(n) writes out the binary representation
// of n.
//=======================================================

void WriteInBinary(long n)
{
  if(n ≥ 2)
  {
    WriteInBinary(n/2);
  }
  printf("%ld", n%2);
}


int main()
{
  long n;

  scanf("%ld", &n);
  WriteInBinary(n);
  return 0;
}