Questions tagged as 'loop'

2
answers

Loop to repeat previous keys (3, 32, 321, ...)

I'm trying to make a breadcrumb dynamic and need to loop to mount the link. For each loop, it needs to repeat the previous items, as in the example below the array and the output. array( array( 'Bairro' , 'bairro' ) , array( 'Rua' , 'rua' )...
asked by 23.11.2014 / 10:07
1
answer

Tie does not perform all it should

I have a problem with my program, so I need it to randomly show an order of numbers (teams). The problem is that when I put a number greater than 10 it does not show the 10, it shows only a few: int cont1, aux, n, sorteio; char op = 's'...
asked by 26.11.2018 / 02:31
1
answer

If inside the loop does not work correctly

Good evening. I have the following function: function verificaOnOff(){ for(var i in tbModulos){ var mod = tbModulos[i]; $.get('http://'+ mod.ip +'/rele', function(data) { if (data == '1') { $('#icone-'+i).removeC...
asked by 30.06.2018 / 01:17
1
answer

Display only results that satisfy the condition within the loop

I am building a small algorithm that traverses a ArrayList and compares the value found with a value entered by the user. But I want to print on the screen only the value that satisfies the operation, not the other values that do not m...
asked by 09.09.2018 / 22:24
2
answers

onBlur (JavaScript) within a Loop For PHP

I have the following Java code: <script type='text/javascript'> function Calc(){ var qnt = document.getElementById('qnt_saida').value; var vlr = document.getElementById('vl_unt_org').value; var tl = (qnt*1) *...
asked by 09.04.2018 / 22:58
3
answers

Why this piece of code is looping infinite?

All variables are declared and Eclipse is not pointing any errors in the whole code. What I need to do: The user can only choose between 1, 2 and 3. Any other input, including texts (example: test ) and other numbers example: 4 ) should a...
asked by 19.05.2017 / 04:13
1
answer

Why does this infinite loop happen?

I made this code but it is looping infinite and I can not fix it ... #include <stdio.h> int main (){ int x, z; while("x=100; x!=65; x-=5"){ z=x*x; printf("%d --> %d\n", x, z); } }     
asked by 10.10.2017 / 05:17
2
answers

"goto" command creating infinite loop in loop "for"

I want to simulate a school database that collects names, math and physics grades, and calculates the mean of both to 5 students (defined in a string of struct ). Any grade above 10 would be allowed, with no lock for that. Students wo...
asked by 28.09.2017 / 14:52
1
answer

More efficient way to compare two variables type List

I have two variables of type List that need to be compared against each other to check for possible duplicates. Example of Variable Content Variable 01: [01, Test, Active] Variable 02: [01, Test, Active] I'm currently us...
asked by 02.03.2017 / 12:13
1
answer

How to transform a while structure in for? And vice versa? [closed]

I'm needing an explanation on how to transform a structure in while to for and vice versa. Thanks in advance for any help!     
asked by 28.04.2016 / 04:02