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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.