Somebody asked me a question: Which one is the fastest among the below two scenario:
for (int i = 0; i < 10; i++)
{
Have you actually tried it?
I would assume theoretically Case II would be marginally faster since there would only be half of the stack-based variable creation / destruction in the outer loop than there would be for Case I, but even better (and clearer) would be:
for(int k = 0; k < 50; k++)
{
count++;
}
To be precise, your examples are so abstracted that the answer is probably of little use. It very much depends on the context.