Questions tagged as 'while'

1
answer

Loop in PHP to check user id

I'm trying to create a function in PHP where it checks if the id of the user already exists, the id is created with the function rand , but even though there are very few chances of the same id appearing, chances are still there! so to nev...
asked by 24.12.2017 / 05:43
0
answers

How to use the while in the tkinter to make the game of Even or Odd?

I'm starting now and so I'm super lost, this is my code: from random import choice from tkinter import * janela = Tk() janela.title("Jogo do PAR ou IMPAR!") fontPadrao = ("Arial", "10", "bold") def jogar(): pc = [0, 1, 2, 3, 4, 5, 6, 7, 8...
asked by 20.12.2017 / 19:21
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
1
answer

Error while in joption pane: loop

I'm having a serious problem with the while in the following algorithm: You have a data set containing the height and gender (male, female) of 50 people. Make an algorithm that computes and writes: 1 - the highest and lowest height of the gro...
asked by 07.12.2017 / 02:33
1
answer

FPDF with MySQL and PHP - Bringing repeated data

I'm trying to set up a generator system of Vouchers/Tickets I have a table in SQL with the name Vouchers with multiple users and their respective passwords. I call each cell the variable $serial_voucher and $senha_vou...
asked by 11.11.2017 / 23:14
1
answer

Doubts about storing values in a variable

I'm having trouble understanding this while loop: #include <stdio.h> main() { int c; c = getchar(); while (c != EOF) { putchar(c); c = getchar(); } } The result of an execution is this: $ ./teste teste tes...
asked by 16.11.2017 / 05:08
0
answers

Loop of sending emails with PHP

Personal this is my first post and I would like your help: I have a database query that sends automatic mail through PHP Mailer in case the activity is delayed, so far so good, the problem is in the repetition , if you have 3 emails to send you...
asked by 17.10.2017 / 15:06
2
answers

My while closing before it really should

I made a code that should take the number of rows from a txt file and then use this same number of rows in a while to convert the columns and rows to array. lines = 0 ln = 0 for line in dataset: line = line.strip() lines += 1 prin...
asked by 25.08.2017 / 01:58
1
answer

Determine the largest prime number after being given a value using while function [duplicate]

I have to create an exercise to find the largest prime number after being given a certain value using the while function, what is wrong with what I created below ?? def maior_primo(n): x=0 y=0 while y<=n: y=y+1...
asked by 07.07.2017 / 16:36
2
answers

Jumping line before time

<script> var i = 0; while(i < 100){ n = 1; resultado = n + i; if(0 === (i%10)){ document.write(n + '-' + resultado + '<br>'); }else{ document.write(n + '-' + resulta...
asked by 16.06.2017 / 07:33