Dunno what you mean by "runtime complexity" and "space complexity". Using a loop means you can do the task a number of times that is not known at compile time. If you know the number of times you have to do the task at compile time then you can just repeat the statement N times, although it is neater to use a loop. The one with the loop will be slower than the one without, because you have the overhead of an increment, compare and jump on each iteration, so loop unrolling is a valid optimisation technique (AFTER profiling etc).