KnowledgeBoat Logo
LoginJOIN NOW

Computer Applications

State one similarity and one difference between while and for loop.

Java Iterative Stmts

ICSE 2009

Answer

Similarity — Both for and while are entry-controlled loops
Difference — for loop is a suitable choice when we know the number of iterations beforehand. while loop is helpful in situations where numbers of iterations is not known.

Answered By


Related Questions