Can you post the console that shows the input and output from your program?

One thing I see is that you do not understand the difference between a character and an int.
The char '0' does not...