+ 1
Selective operation loop in cpp?
How can I create a loop in cpp such that if a given number is even, it divides it by 2 and if it is odd it multiplies it by 3 and adds 1 (3n+1)stuff until the number becomes 1 ?(I want all the values in between).
1 ответ
+ 1
This will help you:
https://code.sololearn.com/c0k7xG5fMG5o/?ref=app