34
loading...
This website collects cookies to deliver better user experience
At the end of this lesson, you should be able to answer the following:
Did you know?
The "Hello, World!" program is the traditional first program for programming languages. It is often the first program written by people who are learning to code.
Console.WriteLine()
.()
. We also need to put the message inside double quotes, like this: "Hello, World!"
Console.WriteLine("Hello, World!");
;
). Think of a statement like a sentence - the semicolon is equivalent to the full stop or period. I'm learning C#!
to the console.Console.WriteLine()
, press Enter to go to a new line and type the next statement.Console.WriteLine("I'm learning C#!");
Console.WriteLine("Hello, World!");
Console.WriteLine("I'm learning C#!");
I'm learning C#!
before the Hello World!
statement, the output would be different.Tip
You may have notice a box popping up while typing. This feature is part of IntelliSense, a helpful tool for writing code. It provides hints, suggestions, and documentation for your code.
Question
What happens when you remove the semicolon from the end of the statements? Will the program run?
Console.WriteLine("Hello World")
Console.WriteLine("I'm learning C#!")
Question
Can you spot the error in this program? (If you're stuck, copy and paste this to the code box. The squiggly red lines will show you where the error is!)
Console.WriteLine(Hello World!);
Challenges
Hi! My name is <NAME>
. Replace <NAME>
with your name, of course.