Statements in C#
A statement is a complete instruction in C#.
The semicolon (;) tells the compiler that you’ve finished writing a command.
Difference Between Console.WriteLine() and Console.Write() in C#
Console.WriteLine() prints a message to the console and moves the cursor to a new line afterward, similar to pressing Enter on the keyboard.
Console.Write() prints output on the same line without moving to a new line.
Common Mistakes New C# Programmers Make
Typing console instead of Console.
Using a comma instead of a period between Console and WriteLine.
Forgetting double quotation marks (" ").
Using single quotation marks (' ') for strings instead of double quotation marks.
Forgetting the semicolon (;) at the end of a statement.
Literals in C#
A literal is a constant value that does not change during program execution.
"Hello" // string literal
10 // integer literal
true // boolean literal
Common Data Types in C#
string --> stores words, phrases, or text.
char --> stores a single character.
int --> stores whole numbers.
decimal --> stores numbers with decimal points.
bool --> stores true or false values.


Top comments (0)