Questions tagged as 'while'

2
answers

Why does not my while work?

I'm studying repetition structure and in one of the exercises I had to check the sex typed, so I made the following code: sexo = input("digite m ou f: ") while sexo != 'f' or sexo != 'm': sexo = input("digite m ou f: ") However, it does...
asked by 22.08.2017 / 14:15
2
answers

How do I force "while"?

This program allows you to calculate the table of up to 10 up to a given number x. But in the cycle of while after the first iteration it does not enter and jumps to the end. For example, if I enter 2 my output is: Introduza o numero...
asked by 17.08.2015 / 19:30
3
answers

Python - Cycle is an alternative to the while loop

Generic considerations: I am currently programming in python ; I have a relatively simple level code; The code contains an instruction loop of type while loop ; I would like to know if there is a way to run the code specif...
asked by 12.05.2018 / 12:48
1
answer

Problem with menu switch case and while

My goal is that after I run one of the menu options and say that I do not want to continue on it, I can insert another option (or the same if you want to go back). My code executes the first option that I type but does not pick up the second,...
asked by 30.06.2017 / 06:26
2
answers

Memory consumption in java

Good morning, people. I made an application in java that at certain times it executes a query to the database and generates a text file. The application is working correctly in the schedules that have been programmed, however in the time t...
asked by 03.08.2016 / 17:08
1
answer

C / How to change the for for a while?

Write the function prints using the while repeat structure instead of for. If necessary I can edit and insert all the code. void imprime(Ccc *p) { Ccc *r; for (r = p; r!=NULL; r = r->proximo) printf("%c",r->caracter); }...
asked by 29.08.2018 / 14:25
3
answers

Use of while within if

I have to read endless averages of students and if they are greater than or equal to 7 the student is approved, if not, he is disapproved, and if I type -1 the program stops and issues a closing message. > I'm trying hard to make this program...
asked by 22.08.2018 / 21:29
3
answers

Display only one message at the end of an operation within a WHILE

I have a situation. I do a search on a table and from the data returned, I insert into a new table and update the current one. Ex: $busca = $link->prepare("SELECT valor FROM tabela1 WHERE funcionario = ? and confere = 0"); $busca->bind_...
asked by 21.09.2017 / 21:50
2
answers

Erasing rows from bottom to top

I'm using the method innerHTML(); to display 60 lines on the page. As soon as I need to delete 20 to 20 lines to each click on the button. Full source code: for (i = 0; i <= 60; i += 1) { document.getElementById("...
asked by 19.05.2016 / 10:14
1
answer

Try-catch in loop causing error

I have the following code, which tries to click a button after 60 seconds, and if it has not loaded, try again after 60 seconds. while(true) { var timeout = setTimeout(function() { try{ document.querySelector...
asked by 10.12.2018 / 15:03