I am confused about this. For example
#include <iostream>
int main(){
using namespace std;
int x, y;
cout << "enter a number: \n";
cin >> x
if (x != ){ // If user inputs anything besides a number, Program will then exit
cout << "invalid";
}
return 0;
}
what code could i use so that if the user decided to input a letter instead of a number, the program will then output invalid and the program will then exit