Dear all,
when i run the prog below it works fine when I input an integer but if I enter a char by mistake the output to the screen goes mad.
what i want to do is write a piece of code that
1) if char input then print to screen "you have chosen to Exit"
Any idea what the code might be.
regards
Tim
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
int no;
do{
cout<<"Enter a Number"<<endl;
cin>>no;
cout<<no<<endl;
} while ( no !=5);
system("PAUSE");
return 0;
}