How can I rewrite the following program in order to not use any loop and branch constructs? (No if, while, break, continue, switch, ...)
for(int i=0; i < 5; i++){
// do stuff
}
The only approach I can think of is to use ugly goto statements:
loop:
// do stuff
goto loop;
But how can I exit this loop after exactly 5 runs? Or is there a different way?
Edit: The solution should not be recursive. Function calls are not yet allowed in the course.