I\'ve written the following function for a Collatz problem:
int collatz(int n){ int steps = 0; do{ if (n%2==0){ n=n/2; steps++; }