Need help with c++ loops and system()

Hello, I am experimenting with while loops and system (“clear”). My usual way of ending my program with return 0; does not work anymore, I want to know how to end my program so I can compile it.

#include <iostream>
#include <stdlib.h>
using namespace std;

int main ()
{
    string e;

    while (e != "4984") {
       system("clear");
       cout << "enter password:  ";
       cin >> e;
       system("clear");
       }
        int r, d, t;

        cout << "enter the oporator: ";
        cin >> t;
        system("clear");
        cout << "Enter the numbers: ";
        cin >> r;
        cin >> d;
        switch (t)
        {
            case '+':
                cout << r + d << endl;
                break;
            case '-':
                cout << r - d << endl;
                break;
            case '*':
                cout << r*d << endl;
                break;
            case '/':
                cout << r/d << endl;
                break;
        }
    }

}


Hey @ethan what compiler are you using?

Also looks like you have more } than { :slight_smile:

That might be why it’s not compiling.