I declared two integer variables and structured the program to get the values through cin and print out the values through cout.
#include <iostream>
using namespace std;
int main() {
int a , b;
cin >> a >> b ;
cout << endl << a << "\t" << b << endl;
return 0;
}
When prompted to input values I deliberately gave a non-integer value for the first variable and got the following output:
char: 0 and 32767float0 and 0- Absurdly large number: 2147483647 and 32767
Why does the output of the second variable differ based on the variable type of the first input?