Answer to Question recursion-6

#include <cstdio>

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

void PrintInBinary(long n)
{
  if(n > 1)
  {
    PrintInBinary(n/2);
  }
  printf("%ld", n%2);
}


int main()
{
  long n;
  scanf("%ld", &n);
  PrintInBinary(n);
  return 0;
}