Question: need full code for both the wuestions with explanation When to use which loop? It is easy to see that the while and do while
When to use which loop? It is easy to see that the while and do while loop are the easier loops to work with, but with practice the for loop gets easier to use, and is more versatile and compact. However, it is importan to note that all of these loops perform the exact same thing, and thus can be used as the solution for any problem that requires a loop. In general, a for loop is used when you know the number of iterations that you'll be making, whereas the while loop and do while loop are used when it is not know. It is possible thougl to use any three for any problem. Nested loops Nested loops consist of an outer loop and one or more inner loops. Each time the outer loop is repeated the inner loops are re-entered and started anew. After the above code has executed, what do you think the value for count would be? Assignment Portion - hand in once completed of stulents ind exch studen'' ' name and wouec, and finully displeys the naries of the stadents with the kroct and second lowest wours. from I00 wa 1,000 , ien per line, that are diviviahe by 3 and 4 , Number are seporated by exally coe space
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
