I'm getting back into programming now that I have some stuff to do with it so I'm trying to regain my skills, and I can't figure out the problem with this. It is not supposed to keep looping if the user doesn't input 'y' or 'n'.
Code:#include <iostream> using namespace std; int main(){ char holla; do{ cout<<"You wanna holla at the world?\n"; cin>>holla; switch (holla){ case 'y': cout<<"Hello World\n"; break; case 'n': cout<<"Why the hell not?\n"; break; default: cout<<"not valid yo\n"; break; } } while(holla!='y'||'n'); return 0; }



LinkBack URL
About LinkBacks



