When using cin, you type in characters (keys on your keyboard) that appear in the command prompt. That's what your program - specifically, cin 0 reads. Normally, it will automatically take as many characters as it needs to input. For instance, if you say
and you type 37643, it gets all 5 characters, treats them as an integer, and correctly puts 37643 into myIntVar.
By using cin.get(), you get only one of those characters, and it is treated as a char.
Sometimes, the command prompt will close as soon as the program finishes, meaning you can't see the output. Putting cin.get() forces the program to wait for the user to enter a key before it can close, and you can see the output of your program.