Questions tagged as 'while'

5
answers

Simple solution for Fibonacci algorithm

I have this statement in hand:    Given the Fibonacci sequence 1 1 2 3 5 8 13 ... n, write an algorithm to generate the sequence up to the nth term, which should be provided by the user. For example, if the user entered the number 40, 40 numb...
asked by 09.06.2017 / 05:46
2
answers

Subtraction of arrays

I have two arrays : A E B A = [1,2,3...] B = [7,5,1...] When I do this subtraction it has the correct subtraction return: console.log(A[0] - B[0]); But when I play in the loop it does not work: while (i = 0) { A[i] - B[i] }    ...
asked by 23.11.2018 / 12:09
3
answers

Function prints list while

How do I do this with the loop while ? void imprime(lista* recebida){ lista* aux; for(aux=recebida; aux!=NULL; aux=aux->prox){ printf("Informacao %d\n",aux->info); } }     
asked by 18.04.2017 / 19:12
1
answer

How do I stop organizing the table in while?

How do I stop organizing this table? Sum, subtraction and multiplication respectively? #include <stdio.h> int main (){ int i=0, num=0; printf ("Digite um n£mero: "); scanf ("%d",&num); printf ("\n"); while (i<=9){ i++;...
asked by 21.10.2017 / 18:08
2
answers

Do While goes into infinite loop

I'm sure my error is in while , but I can not understand what I did wrong. It enters loop infinity. The statement follows:    Implement a program that receives 3 arguments from the command line. O   first and second argument are re...
asked by 30.08.2016 / 01:13
1
answer

do the multiplication of values using soma and while operator

var n1 = Number(window.prompt(" digite o primeiro número ")); var n2 = Number(window.prompt(" digite o segundo número ")); var soma; var num = 0; while( num < n1) { var num = n1+n2+n1; num++;...
asked by 18.11.2016 / 00:05
2
answers

Question using while

I'm new to java and would like some help from you, my code is correct following the exercise I'm doing, but I want to increment it using while to ask the user if he wants to repeat the process of the questions ... but my code is not working ......
asked by 11.09.2017 / 23:15
2
answers

Listing images within a directory

I want to list the images in a directory, but I can not. You are listing the right amount and everything, but the images do not appear. <?php $path = "http://www.imaginew.com.br/administrar/foto_portifolio/galeria/"; $diretorio = di...
asked by 18.11.2015 / 17:44
1
answer

How to do a while with 2 checks

I'm trying to get the while values to stop but it just does not go into while, I'm starting programming so try to help in a simple way Purpose of code: Get 0 of a 1 degree function dynamically ... <?php print("Qual é o expoente de sua...
asked by 13.09.2017 / 23:34
2
answers

Problem with repetition structure while

I made this little code so that it asked for a user and a password. If the data were the same as those defined within the code, show a "success", if the user is different from what is placed in the code, ask the user again. I tried to use the...
asked by 18.06.2017 / 03:15