I am a first year cs major. Today in our lab we had to debug some code and make it work. Below is the result.

```
#include <iostream>

using namespace std;

int main() {

   int x = 3, y;
   char myanswer;
   int val= 1;
   int num;

   y = x;
   cout << "y is set to: " << y << endl;

   bool again = true;
   int ans;
   while (again) {
      cout << "Please input a number: ";
      cin >> y;
      if (x > y)
         cout << "X is greater than Y\n";

      else {
         cout << "X is less than Y" << endl;
         cout << "would you like to input another number?" << endl;
         cin >> ans;
         if (ans != 1)
            break;
      }
      cout << "would you like to input another number ?" << endl;
      cin >> ans;
      if (ans != 1)
         again = false;
   }
   for (x = 0; x < 10; x++)
      cout << x << endl;

   cout << "What number would you like to find the factorial for? " << endl;

   cin >> num;
   cout << num;
   for (int x = num; x > 0; x--) {
      val *= x;
   }
   cout << "Are you enjoying cs161? (y or n) " << endl;

   cin >> myanswer;
   if (myanswer == 'y')
      cout << "Yay!" << endl;
   else
      cout << "I hope you will soon!" << endl;

   return 0;

}

```

After the cout regarding factorials, the cin's don't work and the user ceases to be able to enter input. So far my lab ta's and friends haven't been able to find the issue. The code has been compiled and exected on both my school's engineering servers and my local computer. On both the error persists.