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;
You can convert numeric input string to integer (your code is correct):
int age = Convert.ToInt32(Console.ReadLine());
If you would handle text input try this:
int.TryParse(Console.ReadLine(), out var age);