BototoyTheGreat24
Honorary Poster
- Joined
- Oct 1, 2018
- Posts
- 533
- Reaction
- 109
- Points
- 185
Patulong naman po kung paano gawin yung ulam sequence sa java using while or do-while loop.
If N is 1, stop.
If N is even, replace it with N/2.
If N is odd, replace it with 3 * N + 1.
example:
user input: 6
output: 6, 3, 10, 5, 16, 8, 4, 2, 1
Sana may makatulong. Salamat!
If N is 1, stop.
If N is even, replace it with N/2.
If N is odd, replace it with 3 * N + 1.
example:
user input: 6
output: 6, 3, 10, 5, 16, 8, 4, 2, 1
Sana may makatulong. Salamat!