0

HELP!!! why my answer is incorrect?

Fill in the blanks to create a function that concatenates strings and returns the result. static string Concat(string x, string y) { string res = x + y; //<-- that is the incorrect answer return res; } string msg = Concat ("Finishing ", "the last module"); Console.WriteLine(msg);

11th Jan 2025, 9:28 PM
Reynaldo Acosta
Reynaldo Acosta - avatar
2 Respuestas
+ 3
It was a lesson in the C# course that was poorly coded in an exercise, my answer was correct but it didn't accept it. Anyway, I was able to solve it now. Thanks for your contribution!
14th Jan 2025, 5:01 AM
Reynaldo Acosta
Reynaldo Acosta - avatar
+ 4
Add this in your Program Class, and then it will work. static string Concat(string x, string y) { string res = x + y; return res; } static void Main(string[] args) { string msg = Concat("Finishing ", "the last module"); Console.WriteLine(msg); }
12th Jan 2025, 12:46 AM
Jan
Jan - avatar