Get up to 50 % extra points for free! More info
discount week 50

Discussion: For loop not working properly

Activities
Avatar
Paul Michaels
Member
Avatar
Paul Michaels:11/11/2016 13:56

I get that for loops run through a set amount of iterations, but mine's not working. What am I doing wrong?

for (int i; i < 3; i++)
{
        Console.WriteLine("Knock");
}
Console.WriteLine("Penny!");
Console.ReadKey();
                }
        }
}
 
Reply
11/11/2016 13:56
Avatar
Replies to Paul Michaels
Matthias Quintero:11/11/2016 14:12

You never initialized the iteration counter, so the loop starting point is undefined.

 
Up Reply
11/11/2016 14:12
Avatar
Paul Michaels
Member
Avatar
Paul Michaels:11/11/2016 14:13

Thank you! It works now

 
Up Reply
11/11/2016 14:13
Avatar
Samuel Jackson:12/22/2021 5:37

This is the first time I visit here and I found so much interesting information in your post, thank you.

 
Up Reply
12/22/2021 5:37
Avatar
Tracy Duff
Member
Avatar
Tracy Duff:28. May 18:22

Good evening guys! Our professional essay writing service https://expertpaperwriter.com/…sors-review/ uses only the most qualified authors and editors, which ensures we will always provide you with high-quality support. With hundreds of experts to choose from, we can support you in all of the following subject areas through our professional essay writer and much more

 
Up Reply
28. May 18:22
Avatar
Berzencexx
Member
Avatar
Berzencexx:22. June 10:50

Upgrading the level of customer satisfaction is the goal of this service. The cv writing service uk invests much time in understanding the requirement to provide the best results. The experts on the site enable a newbie to choose the best writer. By discussing the project earlier

 
Up Reply
22. June 10:50
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

6 messages from 6 displayed.