Need help. This should be simple, but i can not seem to get it.
I want to take a double like 0.01 and then times it by 2 for each output.
like this....
0.01
0.02
0.04
0.08
0.16
Do i use a loop of if, else?
Adam Burda wrote:Need help. This should be simple, but i can not seem to get it.
I want to take a double like 0.01 and then times it by 2 for each output.
like this....
0.01
0.02
0.04
0.08
0.16
Do i use a loop of if, else?
If you need to do something more than once, that suggests a loop. So then the question is which kind? If you know in advance how many times, then a for loop is the best fit. If you need to do it until a condition is met, then that's what while and do/while loops are for.