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

learn more… | top users | synonyms (2)

0
votes
2answers
70 views

While Loop Issue

This portion of code is part of a much larger code that I've been working on: def min_t(xd,yd,zd): a=[] for j in i: if j >0: a.append(j) else: ...
1
vote
3answers
47 views

If Statement and while loop

I'm a self taught programmer, and I just started using python. I'm having a bit of a problem, when I execute this code: x = 0 while x == 0: question = raw_input("Would you like a hint? ") if ...
0
votes
3answers
37 views

How to create a function that loops back to the first player from the last player?

This is what I got so far. This game can have multiple players up to len(players). I'd like it to keep prompting the different players each time to make their move. So, for example, if there are 3 ...
0
votes
2answers
89 views

Can a pointer be used to traverse an array of chars?

Can I use char* bufferpntr to traverse an array that is pointed to by char* buffer? example: delete [] bufferpntr; bufferpntr = nullptr; buffer = nullptr; buffer = new char [MAX]; bufferpntr = ...
0
votes
4answers
54 views

In PHP, how do I substitute a string variable before it's evaluated?

Is it possible to expand/substitute a variable before PHP tries to evaluate its truth value? I'm trying to code a single Wordpress template that will execute different queries depending on which page ...
0
votes
2answers
55 views

My code is not giving output , I expected some number

I am expecting some number as output from the above code,but I am not getting it out. I am new to python but started coding with PHP. Sorry if I go wrong some where.thanks # By Websten from forums # ...
0
votes
4answers
62 views

strcmp not working in while loop

What I want to do in my C code is to check for user input and validate that they can only type in either "one" or "two". I made a while loop that checks the user input value with strcmp, but it does ...
0
votes
4answers
79 views

What do C/C++ expressions return?

What do the expressions in C++ return, the actual value obtained after applying the operators on the objects or true/false based on the calculated value ? Particularly : In this code segment : int i ...
0
votes
4answers
74 views

Python: Using two while loops to create grid. No for loops

I'm having trouble trying to get my while loop to keep looping until both conditions are met. I'm only supposed to use while loops or if-statements/booleans if necessary. I'm trying to print the grid ...
1
vote
4answers
51 views

Interleaving execution of two while loops

I have two sensors, that I need to monitor constantly. the inner working of the two sensors are different and I need to check both constantly as shown below. int sensorA(){ while (true) { ...
-2
votes
1answer
48 views

Php script for loading and saving data to database [closed]

Hi I am trying make one script for opencart import. I am almost done but last few line dont work and I couldnt solve it. here are that lines $co="SELECT * FROM oc_coupon"; ...
0
votes
0answers
43 views

while vs for R looping: how to get similar results on two loops

I have heard and read that there are significant speed advantages to using for loops rather than while loops in R. If that is the case, I want to use for loops as much as possible. However, I have ...
0
votes
2answers
31 views

Update Only 1 Row While loop Mistake

I'm still new to writing querys to mysql ad PHP, so I'm sure it is a newbie mistake, but I can't figure it out. When I display Variables with Echo those are Display With Different Value But When I ...
0
votes
2answers
76 views

How to combine in one loop serial numbers and null?

I'm busy with implementation of singly linked list and have 2 functions: insert_back and insert_after. Here is the listing of them: void insert_back(int data) { node *temp1; temp1 = ...
0
votes
1answer
26 views

Which languages support while or do/while loops with automatic iteration indexing?

As the title suggests, which languages support while or do/while loops with automatic iteration indexing? In other words a [while] or [do/while] loop that provides the iteration index automatically ...

1 2 3 4 5 232
15 30 50 per page