0
Whether the fraction can be used in the ( )in the loop?
For example: int n=1; while(n<a fraction){......} Is this right?
1 Réponse
+ 1
You can, but you might want to change variable n to double or float instead of int, otherwise, it will be useless.
NB. Using a fractional value can cause bug in your loop since floating point cannot represents every fractional value perfectly