Create a program and write a method called "GreetPlayer" that takes a string parameter called "name" and prints a greeting message that says "Welcome [name]".
A hint of one possible solution:
First you need to create a string variable in main to store the name value. And then pass it to GreetPlayer-method when calling it. And inside that GreetPlayer-method you need to create a new string variable that stores the information you are going to print.
Create a program and write a method called "GreetPlayer" that takes a
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sachin SinghRank #66 · 26.2K reputationPosted Mar 1, 2023, 12:23 PM EST
test this
public string Greet(string Name) { return $"Hello {Name}"; } public static Main() { Console.WriteLine("Enter your Name"); string Name= Console.ReadLine(); Console.WriteLine(Greet(Name)); }Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 1, 2023, 10:49 PM EST
Hello Akash,
As per your hint PFB program.
using System; class Program { static void Main(string[] args) { string name = "Alice"; GreetPlayer(name); } static void GreetPlayer(string name) { string greeting = "Welcome " + name; Console.WriteLine(greeting); } }Thanks
Naimish Makwana