python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
What is wrong with this code? The answer should be 24 for this question right?
What is wrong with this code? The answer should be 24 for this question right?
int t;
vector<int>arr={24,434};
for(int i=arr.size()-1;i>=(arr.size()-2);i--)
{
t=i;
}
cout<<a...
Himanshu Chand
Votes: 0
Answers: 2
Infinite Loop; Condition is met
I'm having an issue with a for loop that won't end even though one of its conditions is met. The condition in question is the dir + i * move < 0. I can start the loop at 0 and it will begin to decr...
Julian Brooks
Votes: 0
Answers: 0
React.js infinite loop when setting dependent state variable inside useEffect()
I'm building a visual graph editor in React using React Flow. I store the nodes in state as nodes. The user can drag and drop element on the graph, modifying the nodes array.
When nodes is updated, I ...
Andy Ray
Votes: 0
Answers: 0
Scanner method .hasNextInt() and if statement - works only 1 time. For next loop - automatically (didn't wait any input) gives false
I tried to do an input check (need to take 3 numbers using Scanner).
Before that, I used a similar method (.hasNext(int)) in another task - everything worked fine. In this case, it doesn't work.
The f...
IvMovchanets
Votes: 0
Answers: 1