Hi, I have a task to print my name in C#. How can I do it? How many ways there are?
Here is how:
using System; class PrintMyName { static void Main(string[] args) { Console.WriteLine("My name is Jolie Ann"); } }
Here's with variable:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main() { string myName = "Andrew"; Console.WriteLine(myName); } }
With placeholder:
using System; class PrintName { static void Main() { Console.WriteLine("{0}", myName); } }
622 questions
979 answers
129 comments
53 users