I know a while loop can do anything a for loop can, but can a for loop do anything a while loop can?
Please provide an example.
In C-like languages, you can declare for loops such as this:
for(; true;) { if(someCondition) break; }
In languages where for is more strict, infinite loops would be a case requiring a while loop.
for
while