Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

static void Main(string[] args) { String firstName = \"\"; string lastName = \"\

ID: 3665371 • Letter: S

Question

static void Main(string[] args)
        {
            String firstName = "";
            string lastName = "";
           

            Console.WriteLine("Welcome to the payroll system!");
            Console.WriteLine(" Enter data about a faculty member");
           
            Console.Write(" First Name: ");
            firstName = Console.ReadLine();
            Console.Write(" Last Name: ");
            lastName = Console.ReadLine();
           Console.WriteLine("");

How can I get a new line by using /n in C#.

instead of this code........... Console.WriteLine("");

right after last name

Explanation / Answer

//C# program to move to next line using and by not using Console.WriteLine();

//understanding theory first

We have to use together where is a carriage return which takes the curser to the beginning of the line . takes the curser to the next line.Combination of will take us to the next line without using Console.WriteLine.This command only woorks in windows.For linux and mmac,the way of usage is different,We can use it in the following way as shown below