Questions tagged [while-loop]

A while loop is a control structure used in many programming languages to continuously execute a set of instructions as long as a particular condition is met.

0
votes
4answers
81 views

Creating a loop in C++ (still learning)

new here, trying to figure out how to repeat my program. I need to understand how to insert a loop, i think a "do while" loop will work for this, but I am unsure because I have tried a few places of ...
0
votes
2answers
32 views

Selenium goes into infinite loop in Python

I am trying to scrape a website and fairly new to Python. I have managed to come up with below code. The problem however is it goes into an infinite loop after reaching the last page i.e Next button ...
-1
votes
1answer
33 views

While loop printing line incorrectly

import java.util.Scanner;public class US_Defense {public static void main(String[] args) {System.out.println(" ------------------------------------- ");System.out.println(" ...
0
votes
1answer
36 views

Gaming Function in Arduino

I'm trying to make a Whack-A-Mole game using an Arduino Mega with 10 LEDs (Moles) and 10 Push Buttons (Whack). The electronics are completed and tested, everything works fine. It also has a BLE radio ...
-1
votes
1answer
36 views

How does the While statement works in JS?

I'm learning JS in codecademy and it is going very well so far.But on a particular exercise, there's a step which I can't understand. I solved it and ticked all the 3 exercise steps but the outcome ...
1
vote
3answers
52 views

return in while loop

I have a method in c# with a database. Now I try to return the value but because the string is created in the while loop it says that it doesn't exist. Is there a way that the string kampioen with its ...
0
votes
0answers
12 views

How to implement a simple while loop using CTE in SQL Server

I need to implement a stored procedure - where I would be calling another AuditStoredProcedure passing some information.My current implementation using temp table..SELECT * INTO #Temp FROM @RowIds...
-1
votes
2answers
38 views

Difference between while loop and for loop [duplicate]

I'm new to Java.If you want to know what I'm trying to solve, check this: http://codeforces.com/problemset/problem/200/BThe two versions of the code, solve the same problem:1-(for loop) version...
-1
votes
2answers
72 views

How to restart program without it saving its values (C)

I'm trying to make a program that can read and count how many digits a number has, this is my code so far#include <stdio.h>#include <stdlib.h>int main(){int a, b=0;printf("Hey ...
0
votes
2answers
27 views

Subtract previous variable with current variable in php while loop

Actually, I realy don't know how to get the subtract value of same variable.For example (expected value)and my code was as below:$sel=mysql_query("SELECT RIGHT(serial,4) as value, serial, ...
0
votes
2answers
27 views

Create x instances of a class using while loop - python

I am looking to make x instances of a class based on a user's input. Please take a quick glance at my code:class Cut:def __init__(self, length, qty):self.length=lengthself....
0
votes
0answers
29 views

Read in file line by line and search another file for a line with a partial match

I have a file with partial matches to lines in another file. In order to do this I was looking to generate a while loop with read and substituting a variable for each line of partial matches into a ...
0
votes
0answers
31 views

Can't start while loop with networkstream.read()

I am writing small console app which sends file content in a base64 format over TCP. As it seems I can't send the data at once, so I am trying to make a while loop which receives all the data from ...
0
votes
3answers
55 views

How can I validate the amount of times a character appears in an input string?

For instance: I want my users to enter 5 numbers separated by commas...If i wanna make sure that a comma (,) only appears 4 times or else they'll have to re-enter their string again, how do I go ...
0
votes
0answers
27 views

Python - Quit program from “While True” loop with mouse click

Original FileWhy i can not CLOSE program WHEN there is a mouse click on a FRAME during WHILE TRUE loop?Program listens UDP or Sense HAT for input and shows them on a window. it's simple :)What i ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,