using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace for_loop { class Program { static void Main(string[] args) { // Display(); int firstNumber = Convert.ToInt32(Console.ReadLine()); int secondNumber = Convert.ToInt32(Console.ReadLine()); int result = Add(firstNumber,secondNumber); Console.WriteLine(result); Console.ReadKey(); } static int Add(int firstNumber, int secondNumber) { int result = firstNumber + secondNumber; return result; } static void Display() { Console.WriteLine("Hello World"); } } }
Clean Code:
using System; namespace HelloWorld { class Program { static void Main(string[] args) { string takingInputFrom = Console.ReadLine(); string greeting = "Good Morning" + takingInputFrom; Console.WriteLine(greeting); Console.ReadLine(); } } }