Questions tagged as 'while'

5
answers

Skip Registration within a while

I would like to know how do I skip a record within a while? For example, when type is 2 it jumps while($pessoa = mysqli_fetch_object($query)){ if($pessoa->tipo == 2){break;} //continua a exibição de pessoa } However, when running th...
asked by 16.06.2017 / 19:42
2
answers

Is there any difference between an infinite loop with for and while?

In PHP, you can generate an infinite loop with while simply by passing the true parameter. Example: while (true) { echo "Ao infinito e além"; } It is also possible to generate this through for , simply omittin...
asked by 01.10.2015 / 22:55
1
answer

Is there an alternative to multiple whiles loops?

I have a alterar() method that changes the data of a particular element of my XML Person, however, this routine uses several% s of% s for each element, see below the routine: public void alterar() { try { Do...
asked by 10.09.2016 / 23:25
2
answers

How to loop with while using array

Hello, I would like to know if it is possible to loop using while so I need the values of the $newsmedias1 array to be placed in while in order to make the appearance of the items with the given IDS in the Array as lo...
asked by 22.10.2015 / 15:41
1
answer

How do I make the next loop perform?

I have a list with two or more Strings: [Panel, Control] Now comes the problem: for (int i = 0; i < lista.size(); i++){ String linha = ""; while ((linha = leitura.readLine()) != null){ if (linha.contaens(lista.get(i)))...
asked by 25.03.2016 / 07:14
1
answer

Loop Error in R

I created this loop: library(forecast) a=1 b=60 while(b<=(NROW(tsarroz))){ janela=dput(tsarroz [a:b]) serie=ts(janela,freq=6) HW=HoltWinters(serie) prev=forecast(HW,6) result=data.frame(prev$mean) a=a+6 b=b+6 } It should cr...
asked by 10.10.2018 / 02:58
1
answer

End loop when typing specific character

Hello! I need to resolve the following question, but I can not. Write an algorithm that computes the mean arithmetic of the students' 3 grades (number indeterminate number of students) of a class. O algorithm should read, in addition to the n...
asked by 19.09.2015 / 23:53
3
answers

Why does the while not stop?

#include <stdlib.h> #include <stdio.h> int main() { int i,j; char elenco[30]; while(elenco[i]!='s' || i<=20) { printf("indique um menbro do elenco ,se quiser sair escreva apenas a letra S");gets(elenco...
asked by 14.12.2017 / 11:03
2
answers

While with incomprehensible format

My knowledge of java is very basic, and I came across a question that I have not yet answered. The code snippet below is used in some of my applications: File arquivo = new File("ip.txt"); FileInputStream fis = new FileInputStream(arquivo);...
asked by 12.11.2015 / 03:26
2
answers

C ++ - Stopping condition in repetition structure

How to place this code in a repeat structure so that after the calculation the "Type S to exit or C to continue" option is shown? #include <iostream> #include <string.h> #include <locale.h> #include <stdio.h> #include &...
asked by 11.09.2015 / 10:05