Most voted "loop" questions
Loops are a type of flow control structure in programming in which a series of statements can be run repeatedly until some condition is satisfied.
Learn more…671 questions
Sort by count of
- 
		1 votes1 answer54 viewsHow to extract strings from 4 different files, and insert into a single line of an HTML documentFor hours I’ve been trying to find a way to include the contents of 4 distinct files for a new output file -; "output.html". The 4 files I’m looking to extract information from are: link.txt… 
- 
		1 votes1 answer43 viewsHow to use require/include inside the repeat loop?What is the most appropriate way to return the dynamic content of a PHP script, loaded via include within a loop? Below are more details: pagina1.php -> returns the name of the companies… 
- 
		1 votes2 answers7068 viewsHow to get out of one loop inside another through a function in python?Hi, I’m confused and I’m not getting my code right. What I need is to get out of all the loops through the function ask_continue() after the user responds n input without leaving the program,… 
- 
		1 votes1 answer165 viewsGet values from an array separatelyI have a page where shows me text fields to be filled (inputs), containing a "+" in it, in case the user needs more forms to fill in.. The input code of the form that receives the values entered by… 
- 
		1 votes0 answers81 viewsLoop with a pool.query pg(postgres) in the Ode, is giving conflict in the delivery of the SponsesI’m a beginner in Node programming, I hope someone can help me, The problem is this, I am making an app with Node in which you have a for loop with the request body (req.body) and at each iteration… 
- 
		1 votes1 answer131 viewsHow to Stop an Infinite Loop For - VueI’m doing a project with Vuejs and I have these two functions running through an array provided by a JSON fetch. import { api, getCep } from "@/services.js"; export default { name: 'Casos', data() {… 
- 
		1 votes1 answer241 viewsUsing Loop to traverse an array, stopping at the first item and waiting for a click to the next JAVA itemGood evening, folks, I’ve been trying to find a solution to my problem for three days without success. Let’s get to the problem. I have an external API that is on a server, I can already make the… 
- 
		1 votes1 answer252 viewsC++ free(): invalid aborted when trying to create a functionI am trying to create a library for operations with matrices in C++ but am running into a problem. I created a function to print on the screen a certain matrix. The function even returns the… 
- 
		1 votes1 answer70 viewsIs it possible to go through all the lines of a select, through some loop in the Mysql database?I have an application that I developed a few years ago in a hurry, and then I started working to improve its performance. In this app, there is a part of the process that I perform several actions… 
- 
		1 votes2 answers237 views
- 
		1 votes2 answers69 viewsMake sure the entry doesn’t happen again, numerically and within a range?I am programming a game of old. When the user chooses the house where he will mark his symbol (X or O), I need to ensure that: The input value refers to an empty box (which has not previously been… 
- 
		1 votes1 answer88 viewsPython script that generates a main diagonal character squareI am trying to make a program that given a value, generates a "square" of n rows and n columns that has characters : in the main diagonal positions and the characters + in other positions. For… 
- 
		1 votes2 answers69 viewsOFF - Is it possible to print a list value by passing its index?In the code below I,when I come out of the while,I print the athlete jumps data, along with the average of the same. In the loop for,I print out all the jumps of the athlete, 'Cause I wanted to do… 
- 
		1 votes1 answer398 viewsCalculation of cubic root in vectorsHello! I am doing an exercise where it is necessary to calculate the cubic root of 10 numbers stored in a vector and transfer them from vector A (where the numbers were read) to vector B ( where… 
- 
		1 votes1 answer72 viewsHow can I write a loop to calculate each value of a list that is not predefinedHello, I’m beginner in programming and in this forum tb " I am having difficulty calculating the standard deviation of a list of values ( not a predefined list, it is done through an input) How can… 
- 
		1 votes1 answer195 viewsCheck if the content already exists in the text fileI would like to know how to check a TXT file and if you have a line like it does not add the content again, otherwise it adds. I tried to do so: Tokens is an array with several strings, for example:… 
- 
		1 votes1 answer41 viewsLoop in a file being read in CWell, I’m trying to read from a file, and create a loop so I can go through all the characters until I find '<' character. After finding this character, the program must read and save the handle… 
- 
		1 votes1 answer77 viewsCumulative sum of data in new python columnHello personal I have a dataframe with input and output data per day my need and add to that dataframe a cumulative column are daily entries and exits so in excel I would have the following code… 
- 
		1 votes0 answers19 viewsHow does "while / do" work in Scala 3?Reading the changes planned for Scala 3, I discovered that the do-while was discontinued. I understand that a loop do-while can always be rewritten as a while. That said, the article examples with a… 
- 
		1 votes0 answers35 viewsOperation I/O 'Block' loop?Greetings friends, I come here to ask for help in relation to doubt about the operations of Request and with the operation Open. As far as I know and read, the operation file_request =… 
- 
		1 votes1 answer37 viewslooping with dplyr in RI’ve been looking for a solution to a question for days. I intend to create a repeating structure that allows to save a table for each class according to the code below, filtering and saving… 
- 
		1 votes1 answer106 viewsDoubt about looping loops in CI’m trying to solve this question: 3. The user enters two numbers x and y (with x < y): (b) The program returns the sum of the perfect numbers of the range [x, y]. However, he returns the number… 
- 
		1 votes1 answer44 viewsHow to create a loop to list items by clicking a button?I made a stopwatch and when clicking 'Mark Back' it shows the lap time. If you click more times, it will 'listing' the time, one below the other. What I wanted to do and I’m struggling to do is… 
- 
		0 votes1 answer1489 viewsupdate mysql using arrayI’m having trouble inserting an array into the database... I tried this script but it only inserts the last id of the array; <?php $_conexao = mysqli_connect("localhost", "root", "",… 
- 
		0 votes2 answers185 viewsLoop to repeat the previous keys (3, 32, 321, ...)I’m trying to make a breadcrumb dynamic and need to make a loop to mount the link. At each loop, it needs to repeat the previous items, as in the example below the array and the output. array(… 
- 
		0 votes1 answer67 viewsLoops do not keep valuesHello! I am trying to develop a simple program that does an automatic accounting calculation, however, the condition within the for(while, while, if / Else, either) does not maintain its values. The… 
- 
		0 votes1 answer134 viewsFunction does not continue after second run in the same classWell, I’ve been developing a kind of "content slider" that changes the content of a certain div ('.item .frase-test') for the content of the following item in the order of <span>. I’ve managed… 
- 
		0 votes2 answers2047 viewsTraverse components of form C#Hello I have a table coming from the database, with several rows and columns. One of these columns is stored the address of the previously saved image. Now I need to go through all Picturebox and… 
- 
		0 votes2 answers205 viewsJavascript loop does not add object propertyfollows my code var canvasEvents = new Object; canvasEvents['05-30-2015'] = '<a href="#" target=_blank>CAMPEONATOS SUL-AMERICANOS DE ATLETISMO</a>';… 
- 
		0 votes1 answer248 viewsAdding values to the Hashmap <Integer, List<Integer>> and fetching them through the key?I’m making an app focused on external vendors. 1 external seller has several customers, and also several products, which is traded freely with these customers. These products do not always remain at… 
- 
		0 votes1 answer309 viewsJava: Filereader reading number not in the fileI have this TXT: 1,2,4,8,7 45,18,27,35,44 17,45,2,8,6 And I want to read this matrix to a Java array. Here’s the code: public static void main(String[] args){ double[][] pesos = null; String… 
- 
		0 votes0 answers194 viewsHow to loop within a variable in Javascript?I have a page index.php. In it has a loop which collects row by row from a mysql database table and inserts into variables that are sent to the file dashboard.js where the code is below. var… 
- 
		0 votes0 answers118 viewsJquery - Loop a functionGood evening everyone. I am learning a little Jquery and wanted a help. I have the following code: $(document).ready(function(){ $('#btnEnviar').click(function(){ var caminho = ("/uploads/");… 
- 
		0 votes1 answer2606 viewsInsert a loop inside another loopI wish to add the second to the first. For illustration, I will use the simple example below as a basis: <script> n = 10; for ( var i = 0; i < n; i++){document.body.innerHTML += i;} for (… 
- 
		0 votes1 answer98 viewsWordpress how can I create multiple loops in the index?I’m trying to create several loops on my index in wordpress , I wanted to call the posts as follows: Releases: showing only 6 posts. Series: Showing only 6 posts. Recent Movies: Showing only 6 posts… 
- 
		0 votes2 answers73 viewsArray with inputs and a specific data!only here to settle certain things. I’m breaking my head to make this loop but I haven’t got it yet. How do I put the highlight in this array() and only 1 of these photos will be marked with the… 
- 
		0 votes2 answers91 views
- 
		0 votes1 answer1432 viewsHow to transform a while structure into for? And vice versa?I am in need of an explanation on how to turn a structure into while to for and vice versa. I thank anyone who can help! 
- 
		0 votes1 answer749 viewsHow to create loop thread in c#?How do I create a thread that runs a function, wait 1 second and loop again until the program shuts down? 
- 
		0 votes0 answers39 viewsI cannot assign a value to the last element of an arraystruct Numero{ ishort num; Paragraph *next; }; ishort array[3]; array[0] = grid1; array[1] = grid2; array[2] = grid3; array[3] = grid4; ishort i = 0; Numero *n; Numero *t; Numero *h; //lista… 
- 
		0 votes1 answer181 viewsUnlink is not working within loopI have been trying for some time to delete images from a folder through an unlink within a loop,in the case while,but I’m facing the error: PHP Warning:… 
- 
		0 votes2 answers138 viewsDownload multiple Curl pages at the same address without overwritingI need to download this page several times, it returns a different result each time it is accessed: i="0" while [ $i -lt 10 ]; do curl -O http://httpbin.org/bytes/128 i=$[$i+1] done But each time… 
- 
		0 votes1 answer612 viewsEdit specific XML data with LOOP using form in PHP fileI’m having some problems trying to edit specific data (with LOOP) of XML with form in a PHP page. PHP file: input.php (no loop) <meta charset="UTF-8"> <?php if(isset($_POST['submit'])){… 
- 
		0 votes1 answer540 viewsProgram to calculate media#include <stdio.h> #include <stdlib.h> int main() { int sum = 0; int times = 0; int number; int average; while ( number != 9999 ){ printf( " Type the number and i will make the average,… 
- 
		0 votes1 answer438 views
- 
		0 votes1 answer101 viewsJavascript Loop - 1 + inputGood night, you guys! I’m locked in a Javascript loop, it’s as follows: User type any positive number, example 15. Need to provide on the console the number 1 up to 15. The problem is that I do not… 
- 
		0 votes1 answer131 viewsHow to find the sum of two numbers in an array that matches the input valueHow to do this without the need to make two bonds. Sample method: function getPairNumbers($array, $valor) { //aqui viria o método } 
- 
		0 votes1 answer366 viewsHow to loop with jquery without duplicatesI wanted to know if you can make a loop inside the other using the function each without duplicating the values Example var cor = ["branco", "preto"]; var exa = ["#FFF" ,"#000"]; $.each(cor,… 
- 
		0 votes0 answers45 viewsWordpress pagination using wp_pagenaviI am making a pagination in wordpress using wp_paginavi. is working, he is creating the pagination, the problem is that the posts are not changing according to the pagination. My loop: <?php… 
- 
		0 votes1 answer366 views