/* this is a simple program for you to test your non-recursive version of foo3
	for homework 2
							Gang Qu
							Sept. 22, 2016
*/

#include <stdio.h>
#include <math.h>

void foo(int n)
{ if (n > 0)
  { foo (n/2);
    printf("%d", n%2);
  }
}

int main()
{ int i=0;
  
  for (; i<10; i++)
  { printf("%d: ", i*i);
    foo(i*i);
    printf("\n");
  }

  return 0;
}

