C# C# Basics (Retired) Console I/O Formatting Output

Ali Dabbir Khan
Ali Dabbir Khan
1,076 Points

I don't understand the error

Explain the mistake please

CodeChallenge.cs
using System;

Console.WriteLine("What is your first name?");
Console.ReadLine();

string firstName = Console.ReadLine();

1 Answer

Antonio De Rose
Antonio De Rose
20,856 Points
// few mistakes
// 1) no need of using System, in the workspace, unless it is being asked for
// 2) your order is wrong, and does not make any sense

//  string firstName = Console.ReadLine(), this is correct, and it would have to come right at the top
// then, you will have to use Writeline, to print the name which is already inside the firstName variable.
Ali Dabbir Khan
Ali Dabbir Khan
1,076 Points

I just started today, do you mind showing me how this is fixed? Thank you

I tried putting the string on top but I don't get the last comment

Ali Dabbir Khan
Ali Dabbir Khan
1,076 Points

Oh it worked, thanks a lot :)