# Questions tagged as 'while'

1

## Difference between algorithms that read numbers until you receive the number 999

What's the difference between these codes? First code: cont = 0 n = 0 total = 0 n = int(input("Digite 999 para parar")) while n != 999: n = int(input("Digite 999 para parar")) cont += 1 total += n print(total) Second code:...
2

## insert a cursor within a while in android

In android I have a cursor where it looks for the data in the database and perfectly returns the data but .. How do I insert a second cursor into the first one? to pull data from a second table My code try { StringBuilder sbQ...
2

## What is the error in this loop?

I want to download an .exe file from my FTP server, but it has a part in the code that is giving me trouble. Error: Invalid expression term 'while' (CS1525) Can anyone tell me what's wrong? FtpWebRequest request = (FtpWebRequest)WebReque...
1

## Why does this infinite loop happen?

I made this code but it is looping infinite and I can not fix it ... #include <stdio.h> int main (){ int x, z; while("x=100; x!=65; x-=5"){ z=x*x; printf("%d --> %d\n", x, z); } }
3

## While loop - number counter minus 0

Good evening! I need to apply a loop for the user to always enter a number (via prompt), when typing 0 should appear an alert stating the number of numbers entered, not counting zero. I'm not understanding what I'm doing wrong, as it is di...
1

## How to transform a while structure in for? And vice versa? [closed]

I'm needing an explanation on how to transform a structure in while to for and vice versa. Thanks in advance for any help!
1

## how to group result mysql while inside table html php [closed]

Good afternoon someone can give me a light I'm trying to organize the data within the while, now I can get the data and put it in the normal table so my problem is when there are many items inside a volume of it gets repeated a lot of time the n...
1

## Doubt while while

I have the following code: # -*- coding: utf-8 -*- def soma(lista): soma_num = 0 while soma_num <= lista: soma_num += a return soma() a = [1, 2, 3, 4] print(soma(a)) I know that it will give error in line 7 and 10, s...
1