Questions tagged as 'while'

2
answers

javascript function that calls another javascript function within a while [closed]

I have a problem executing a javascript function that in its scope has a while that according to the counter is incremented, it is called a second javascript function passing as parameter the counter value: function funcaoA(){ var cont = 1...
asked by 01.02.2016 / 11:10
1
answer

Foreach within While

Capture in an array the values received via checked checkbox post, these checkboxes have the values equal to the field names of the table, I need to query with while and print the fields referring to array: <?php $campos = '''.implode('...
asked by 22.05.2015 / 03:48
1
answer

python - strange tie

I'm almost finishing my application. In the final moments of the code I'm locking in a loop that I can not resolve. # O programa pede para o usúario inserir uma data no formato dd/mm/aa, # e efetua uma série de cálculos simples até chegar num...
asked by 23.03.2018 / 16:45
1
answer

Replacing Wrong Words in a Text Field

I would like an idea of how to create something of the type, text field, where we enter some wrong word (s) and then it is corrected. For example: <body><input type="text" id="exibir" onkeyup="troca()"/></body> <scri...
asked by 15.04.2016 / 03:41
3
answers

How to use "while not in" in Python?

I tried looping while to check if a condition was met. If the user types 0, 1 or 2 the program should stop asking the user which number he will choose. If the user chooses a number other than 0, 1 or 2, the program will ask the user which number...
asked by 22.05.2018 / 19:25
4
answers

Repeat Loop in C

Hello, I'm a beginner in programming and I have a question: I'm doing a program that has a menu and a register to be performed by the user. I would like to know how to make the program menu always appear after finishing the registration, instead...
asked by 29.09.2017 / 02:25
2
answers

Calculate the age group of 10 people within a loop of repetition?

Below is the code I'm using, it has the following error: SyntaxError: invalid syntax [email protected]:~/Documentos/Algoritimos$ python3 prova_lista.py File "prova_lista.py", line 23 elif 18 pessoas <= 65:    Make a program th...
asked by 30.10.2018 / 20:11
3
answers

What condition can I develop to avoid duplicating values?

How to avoid duplicate numbers in this random generator? var soma = 0 while (soma < 1000) { soma += parseInt(Math.random() * 100) document.write(soma + "<br>") } As you run, it arrives at a certain point that i...
asked by 24.03.2017 / 12:25
2
answers

Why does the loop not print until the last value was entered as a limit?

I made a code that prints a sequence of numbers, from the number entered to the end, but when I print it the last number is not appearing. Example: first number entered is 3 and second is 7. The sequence would be 3, 4, 5, 6, 7, but 7 does not...
asked by 25.10.2018 / 03:22
2
answers

PHP - shuffle array

I'm scheduling a news feed page in PHP . I ask your help to help me shuffle the $tagsArray array so that the posts are not always in the same order. Thank you in advance! Code: <?php $conexao = mysqli_connect("localho...
asked by 19.02.2018 / 22:21