Code Snippet in coding module is showing incorrect result!

Suvin Hugar 20 Reputation points
2024-02-28T05:54:57.65+00:00

I am currently going through the Microsoft Foundational C# training through the Learn platform. In the first module, the first exercise is to print some lines. This is the code provided:

 Console.Write("Congratulations!");
 Console.Write(" ");
 Console.Write("You wrote your first lines of code.");

However, instead of the output being:

Congratulations!
You wrote your first lines of code.

It is: Congratulations! You wrote your first lines of code. Please help with this issue because the module needs to be corrected.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,855 questions
{count} votes

Accepted answer
  1. Minxin Yu 11,506 Reputation points Microsoft Vendor
    2024-02-29T06:24:43.78+00:00

    Hi,@Suvin Hugar

    The snippet in document is wrong
    Should be

    Console.Write("Congratulations!"); 
    Console.WriteLine(" ");
    Console.Write("You wrote your first lines of code.");
    

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.