Skip to main content
1 vote
2 answers
88 views

Why doesn't continue remember the command's exit status in sh? Given this loop: #!/bin/sh for i in 0; do false || continue done echo $? Output: 0 #!/bin/sh for i in 0; do false done echo $? ...
Rihad's user avatar
  • 139
-1 votes
2 answers
118 views

I face the following problem, which looks like a bug (or maybe am I the bug): I have a loop: #!/bin/bash # TARGET=/sd/REMOTE_BACKUP LOGDIR=/sd DEBUG=: # Init daily information (reset on each run and ...
Alan's user avatar
  • 7
1 vote
0 answers
29 views

I'm creating a multiplication game and am suck on two things. I know they deal with break and continue use. repeating the same question over again until it is right providing an option to quit and ...
Tiffany J Munn's user avatar
0 votes
1 answer
42 views

I need this to rerun the initial inpput question if it gets a value that is unacceptable. try: hours = float(input("Please enter your hours worked: ")) if hours < 1 : ...
Jennifer Sigler's user avatar
2 votes
2 answers
140 views

I have a C program with many functions nested, all controlled by a main loop, I need to carry out checks in the functions which, if true, must return the control to the main loop, interrupting that ...
Paolo Di Biase's user avatar
0 votes
3 answers
90 views

I would like to skip an iteration of code if, the data in a cell does not match a string - number - number format. For example, the desired format is Apple-34-56. If the array that I defined has a ...
trend's user avatar
  • 9
2 votes
1 answer
157 views

When piping the output of a command to a ForEach-Object loop in PowerShell, using a continue statement causes it to error out. Works as expected: ipconfig | ForEach-Object { $_ } Errors: ipconfig |...
DeadChex's user avatar
  • 4,730
0 votes
3 answers
1k views

I have a do-while loop designed to get a number from user input in the console. I included error checking and many optional variables to make it versatile (i.e. min and max allowed values, an array of ...
moshesilver's user avatar
5 votes
3 answers
2k views

It's fairly well documented that foreach processing speed varies depending on the way a foreach loop is carried out (ordered from fastest to slowest): .ForEach() method foreach ($item in $collection) ...
Paul π's user avatar
  • 583
1 vote
1 answer
94 views

I'm a beginner trying to solve this kata: In this kata you are required to, given a string, replace every letter with its position in the alphabet. If anything in the text isn't a letter, ignore it ...
nesfel's user avatar
  • 13
-2 votes
3 answers
222 views

How do I restart a foreach loop when I reach the last index and some other condition? The loop needs to run again, instead, it just stops. foreach ($getUsers as $index => $user) { $userID = ...
ABigBird's user avatar
2 votes
1 answer
43 views

I am trying to ask a user if they would like to try again a new computation, I used old code from another lab I had but can't seem to get it to adjust proper for this new one. My problem is that when ...
Spongebuild's user avatar
0 votes
1 answer
55 views

I am a beginner firstly. I just wrote this simple code but I have one problem. Whenever you guess the wrong number once and try to stop playing, it just doesn't respond to you and continues whatever ...
Vald1z's user avatar
  • 9
-7 votes
2 answers
220 views

The continue statement is for skipping the iteration but it doesn’t work as I expect. Here is my code: int i = 0; do { if(i== 10)continue; printf("\n This is = %d",i); i++; } while ...
user3737377's user avatar
-2 votes
2 answers
141 views

// Online C++ compiler to run C++ program online #include <iostream> using namespace std; int main() { for (int i = 0; i<=15;i+=2){ cout<<i<<" "; ...
Anshika Verma's user avatar

15 30 50 per page
1
2 3 4 5
49