collatz value
in
Programming Questions
•
5 months ago
I get required to write the function collatzVlaue, that when passed an integer, return its collaztvalue, it returns the number of operations it takes to reduce that number to one.
For example: if n=10
10=>5=>16=>8=>4=>2=>1
that means if n%2==0 , I will be divided by 2 whereas It will multiply by 3 and plus 1
when I used loop for to count how many operation the number take, I always get the error "expecting EOF, found 'for'"
plz help me
1