I\'m a beginner who is learning .NET.
I tried parsing my integer in console readline but it shows a format exception.
My code:
using System;
Your code is absolutely correct but your input may not be integer so you are getting the errors. Try to use the conversion code in try catch block or use int.TryParse instead.