Answer to Question #274820 in C# for aman

Question #274820

the program is showing system exception at "choice "Convert.ToInt32(Console.ReadLine());"


1
Expert's answer
2021-12-02T14:15:25-0500
internal class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Enter number:");


            try
            {
                Convert.ToInt32(Console.ReadLine()); 
            }
            catch (FormatException exp)
            {
                Console.WriteLine(exp.Message);
            }


            Console.ReadKey();            
        }
        
    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS