Hello, I’m working on this task:
Write a program that reads the user’s name. If, and only if, it is “Ritchie”, output to the console “Access granted”.
Here is my code:
namespace ConsoleInput
{
public class AccessChecker
{
public static void Main(string[] args)
{
Console.WriteLine("enter name");
string name=Console.ReadLine();
if(name==ritchie)
{
Console.WriteLine("access granted");
}
else
{
}
}
}
}
Can anyone please help me to solve it?