+ 1
How to write a program in C++ which continually asks for users input and terminates when typing "Exit"
C++
5 ответов
+ 7
U can write that program by learning syntaxes of c++ along with some practise.
If u want us to help, pls post ur try(code):)
+ 2
//it is not terminating :( it must terminate using exit or EXIT or Exit
#include <iostream>
using namespace std;
int main ()
{
string stringVariable;
for (;;) {
do {
cout <<"Enter a random text: ";
cin >> stringVariable ;
cout << stringVariable << endl ;
}
while(stringVariable != "exit" || "EXIT" || "Exit");
if (stringVariable == "exit" || "EXIT" || "Exit" );
break;
}
return 0;
}
+ 1
Thanks a lot everyone, great help! :)))))))