on-internet
← Community

Using multiple methods to create a simple calculator

Stack Overflow ·

I wrote out a simple calculator that uses multiple methods. This is what I wrote out, but is there a better/more efficient way to write this code? Suggestions would be helpful. I want to use multiple methods and have everything visible in the main method. I know it looks silly and can be done in a much more simple way, but I'm trying to explain this to people who are new to C# and are beginning to learn about methods. { Console.WriteLine("Please input two numbers"); int num1 = Convert.ToInt32(Console.ReadLine()); int num2 = Convert.ToInt32(Console.ReadLine()); int answer1 = Sum(num1, num2); in

Comments

Sign in or sign up to comment and upvote.

No comments yet.