[Solved] Stuck in infinite loop C#

[ad_1] The problem is your use of while loops. while(note != 1) There is nothing in the body of those loops that change that condition. So everytime the loop goes “okay… is note not equal to 1?”.. that condition is always true. So the loop executes again. [ad_2] solved Stuck in infinite loop C#

[Solved] How do i stop loop

[ad_1] First problem you would have with the current code is that once you have clicked the button it would result in lot of messages being sent even before user realizes that he sent that many messages, you need to induce a delay between each message. The next problem is that your app could hang … Read more

[Solved] HOW to back for the beginning if the user press any key except 1 or 2 or 3? [closed]

[ad_1] Use do–while loop and set the condition to while(L != ‘1’ && L != ‘2’ && L != ‘3’);: do { L = getch(); switch (L) { case ‘1’ : system(“cls”); printf(“111111111111111”); break; case ‘2’ : system(“cls”); printf(“222222222222222”); break; case ‘3’ : system(“cls”); printf(“33333333”); break; default : sleep(0); } } while(L != ‘1’ && … Read more

[Solved] Break out of Python for loop

[ad_1] You could just iterate until 5 instead of 6 and print your message out of the loop: for counter in range(5): # Remove the if statement: # if counter == 5: # print(“”) # break myCar.accelerate() time.sleep(1) print(“Maximum speed reached!”) 1 [ad_2] solved Break out of Python for loop

[Solved] C# in Visual Studio [closed]

[ad_1] You may start with the largest number first, something like: foreach(number in positiveNumberArray) { if (number > 50) Console.WriteLine(“Out of Range”); else if(number > 40) Console.WriteLine(“Range 40-50”); else if(number > 30) Console.WriteLine(“Range 30-40”); else if(number > 20) Console.WriteLine(“Range 20-30”); else if(number > 10) Console.WriteLine(“Range 10-20”); else Console.WriteLine(“Range 0-10”); } Edit: To count the up … Read more