2 run time errors

@mudit2jain
In your code Runtime error is caused by number format exception,at line 7.
Morover,to check your logic is correct or not,please do it using Scanner.

Yeah, its working fine with scanner