# C++ command?

**URL:** <https://forum.kirupa.com/t/c-command/177437>\
**Category:** Uncategorized\
**Created:** [February 1, 2006, 11:16pm UTC](https://forum.kirupa.com/t/c-command/177437 "2006-02-01T23:16:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeldafreak](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@zeldafreak](https://forum.kirupa.com/u/zeldafreak)\
**Post date:** [February 1, 2006, 11:16pm UTC](https://forum.kirupa.com/t/c-command/177437/1 "2006-02-01T23:16:50Z")

</div>

hey, im learning c++ and it would be helpful if i could have the person type exit to exit. more on bottom. here is the code.

```auto
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    int a;
    string yes="A equals 10.";
    string no="A does not equal 10.";
    string text="Enter a number to see if it is A.";
    cout<<text<<endl;
 
    while(a!=10){
                 cin>>a;
                 if(a==10){cout<<yes<<endl;
                 cout<<"Type exit to close window"<<endl;
                 }else{
                       cout<<no<<endl;
                       }
                       }
    system("PAUSE");
    return EXIT_SUCCESS;
}

```

Where the last 2 brackets are, i want it so if you type exit, it leaves, instead of the default “press any key…” thing. Thanks. 😃
