I am coding C++ in Nano on PuTTy. When I program a program, my class normally has a program already made that we redirect our input too... so it gets it from the file that the class provides, rather than input from the actual keyboard. I am currently trying to do it from the keyboard, rather than using their file they provide... and it works, but it doesn't prompt me for what I need to enter.
We are working on the Sieve of Eratosthenes program, and I am supposed to enter an upper limit.
It should prompt me to Enter the upper limit right?
In fact, when I do go to execute it doing prog3.exe &> prog3.out, it just goes to the next line, and waits for me to enter something. I enter 25, and in the prog3.out file, it shows
It works just fine, but just wondering why I don't get asked to enter the upper limit. I am relatively new to C++ coming from JAVA and just wondering why. :good:
We are working on the Sieve of Eratosthenes program, and I am supposed to enter an upper limit.
Code:
cout << "Enter the upper limit: " << endl;
cin >> upperLimit; //gets input for upper limit.
cout << endl << endl;
It should prompt me to Enter the upper limit right?
In fact, when I do go to execute it doing prog3.exe &> prog3.out, it just goes to the next line, and waits for me to enter something. I enter 25, and in the prog3.out file, it shows
Code:
Enter the upper limit:
The prime numbers:
2 3 5 7 11 13 17 19 23
It works just fine, but just wondering why I don't get asked to enter the upper limit. I am relatively new to C++ coming from JAVA and just wondering why. :good: