Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

which is more accurate in giving resulting values,while or do while. explain.

OpenStudy (anonymous):

neither is really more accurate than the other. Its more of a matter of when the loop takes place. A while loop checks the condition before the loop, a do while loop executes at least one iteration of the loop and then does the check. So, if you must ensure the loop is executed at least once, use a do while.

OpenStudy (anonymous):

generally while loop is preferred over do while

OpenStudy (anonymous):

both have there own properties ... it according to the logic which one you used . both gives the accurate result

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!