Answer the question
In order to leave comments, you need to log in
Is it good to use a separate method for input?
I want to write code normally, and not to code, is it worth doing input through methods?
How else can this code be improved?
using System;
using System.Globalization;
using System.Linq;
namespace SimpleCode
{
class Program
{
static void Main(string[] args)
{
int num1, num2, num3;
Console.WriteLine("Введите числа");
EnterNum(out num1);
EnterNum(out num2);
EnterNum(out num3);
Console.WriteLine();
Console.WriteLine(num1);
Console.WriteLine(num2);
Console.WriteLine(num3);
}
public static int EnterNum(out int number) => number = int.Parse(Console.ReadLine());
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question