When you declare some thing of the sort
int int1;
The compiler gives any arbitrary value to i. This could be 0,1,2,... any value what so ever.
As you input a char in response to the second cin, the compiler ignores the value entered by you.
Later when you want to display the entered value, the compiler prints the value of i, which will be garbage in your case
Run this code. If you give the input AZ, it will print A-1
int main()
{
char ch1;
int int1=-1;
cin >> ch1;
cin >> int1;
cout << ch1 <<"\n";
cout << int1 << "\n";
getch();
return 0;
}
I hope this clears your confusion