1

NEED HELP: C#

Please I am a Beginner in C# and I need little help with Methods.

In the Picture attached, I'd love to use User input as Parameters in the method. Example: example getting user imput with Console.ReadLine(); and storing it to num1 or num2 as parameter in the Method.

Is this possible in C#, if so, how can I make it work? Thanks

Comments
  • 1
    You can do something like

    int x = int.Parse(Console.ReadLine());
    int y = int.Parse(Console.ReadLine());

    And then pass those into the function
  • 0
  • 2
  • 1
    This is a joke... Right?
  • 0
    Look up the Microsoft Dragonfruit NuGet package.

    It's prerelease, but allows you to add typed parameters to the main method and auto generates help documentation.
Add Comment