Questions tagged [infinite]

An infinite structure or process is one which does not terminate. Infinite loops or structures may be bugs in certain contexts, but also may be desired behavior, particularly in server-processes or lazy languages.

An infinite structure or process is one which does not terminate. Infinite loops or structures may be bugs in certain contexts, but also may be desired behavior, particularly in server-processes or lazy languages.

1090 questions
-3
votes
1 answer

Infinite sequence 12345678910111213

Given an infinite sequence of numbers: 12345678910111213141516..... and so on. I have to find a first position of an input string. Like this: 1234 gives 1 13 gives 16 111 gives 12 Anyone already figured out an algorithm for such…
Zencaster
  • 13
  • 2
-3
votes
3 answers

Basic Function Producing Infinite Loop

Here is my code: #include #include int main(void) { double x, y, z; double numerator; double denominator; printf("This program will solve (x^2+y^2)/(x/y)^3\n"); printf("Enter the value for x:\n"); …
-3
votes
2 answers

Stuck in Infinite While Loop, what to do

This does not accept any answer: cout << "Restart yes or no: "; cin >> retry; while (retry != "yes" or retry != "no"){ cout << "Restart yes or no: "; cin >> retry; system("cls"); } If anybody can provide an alternative/fix it would be…
Resmik
  • 7
  • 1
-3
votes
4 answers

How do I create a infinite loop in java

I am writting a simple programs using java for my school assignment. I cant find a way to create a infinte loop. Its a survey program which i have to redesign it so it does no only count 5 people but as many as I want untill I end it. Here is a…
user3499202
  • 71
  • 1
  • 6
-3
votes
3 answers

Infinite loop stuck

I have been looking at this for a bit.. and I even put in the item = null to see what happens.. but this bit of code keeps getting stuck in an infinite loop. item is always equal to null and should kick out of the loop but it keeps running. …
user2368621
  • 1
  • 1
  • 1
-3
votes
1 answer

Infinite loop with .eof() method

Im trying to do my C++ exercise about the Album Project. Basically, i need to have 4 classes, namely: Duration, Track (duration object + title of track), Album (Name of artist, title of album and a collection of my Track object) and AlbumCollection…
-4
votes
2 answers

Program stuck in Infinite loop

My program is going in infinite loop and does not print required output please help anyone
-4
votes
1 answer

How to loop a Console.ReadLine to the infinite?

Hello i'm trying to create a calculator game but it loops only 2 times and (idk why)not til the user finds the result with input. And i'll later see how to make a random generator of numbers instead of writing them by myself in the code. Ty for…
Nippa
  • 1
-4
votes
1 answer

Infinite SQL Loop Issue

Super basic stuff here but i just can't seem to stop the loop repeating to infinity. I started by grabbing count values and storing them to the variable but when that didn't work i wanted to strip it back to the basics by just declaring the numbers…
-4
votes
4 answers

infinite while loop with | operator c++

I'm going through Bjarne Stroustrup's Principle's and Practices using C++ and I'm stuck on one specific exercise. The exact question is: "Write a program that consists of a while-loop that (Each time around the loop) reads in two ints and then…
-4
votes
1 answer

How to make an infinite java program?

I want to make a utility program which shows the date, hour ... : import java.text.SimpleDateFormat; import java.util.Date; import java.util.Scanner; public class hh { public static void main(String[] args) { Scanner mihai = new Scanner…
Mikey
  • 29
  • 2
  • 2
  • 4
-4
votes
3 answers

Why is the for loop turning into an infinite loop?

Why is the code below resulting in an infinite loop? #include void main() { int i; for(i=0;i!=12;i++) { printf("%d\n",i); i=12; } }
Tarun Dev
  • 19
  • 1
-4
votes
1 answer

C++ Infinite-loop, Issue with returning

void phonebookmenu() { phonebook ph; string str; cin.ignore(); cout << "PH> "; getline(cin, str); //Input from user. string buf; // Have a buffer string. stringstream ss(str); // Insert the string into a stream. …
Widdin
  • 47
  • 1
  • 4
-4
votes
3 answers

HasNextInt() Infinite loop

//input: multiple integers with spaces inbetween Scanner sc = new Scanner(System.in); while(sc.hasNextInt()) { //add number to list } sc.hasNextInt() is waiting for an integer. It only breaks out if you input a non-integer…
user3603865
  • 57
  • 1
  • 8
-4
votes
2 answers

C++: How can I make an infinite loop stop when pressing any key?

What is the best way to terminate a while loop by pressing a specific key in C++?
nermitt
  • 127
  • 12
1 2 3
72
73