#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
cout << "What is your favourite number?";
cout << endl;
int FavNumber;
cin >> FavNumber;
cout << "You favourite number is " << FavNumber;
cout << " !!!";
cout << endl;
getchar();
getchar ();
return 0;
}
For the sake if knowledge only, may you please tell me why that when i run my program then enter a letter for my favourite number instead of a number the program closes. It doesnt do that with getch! And Also when i ran the program and wrote lots of numbers for my favourite number, the program said my favourite number was '-858993460', Please tell me why! Thanks In Advance!