Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print a message to the console.
C Sharp (C#)
Console.[1]("Hello, world!");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ReadLine instead of WriteLine causes the program to wait for input.
Using Write prints without moving to a new line.
✗ Incorrect
The WriteLine method prints the message and moves to the next line.
2fill in blank
mediumComplete the code to read a line of input from the user.
C Sharp (C#)
string input = Console.[1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using WriteLine instead of ReadLine causes no input to be read.
Using Read reads a single character, not a full line.
✗ Incorrect
The ReadLine method reads a full line of text input from the user.
3fill in blank
hardFix the error in the code to correctly print the user's name.
C Sharp (C#)
Console.WriteLine("Hello, " + [1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Console.ReadLine() inside WriteLine causes the program to wait for input again.
Using Console.WriteLine() inside WriteLine is incorrect syntax.
✗ Incorrect
The variable input holds the user's name and should be used here.
4fill in blank
hardFill both blanks to read an integer from the user and print it.
C Sharp (C#)
int number = int.Parse(Console.[1]()); Console.[2]($"You entered: {number}");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Read instead of ReadLine reads only one character.
Using Write instead of WriteLine does not move to a new line.
✗ Incorrect
Use ReadLine to get input as text, then WriteLine to print the message.
5fill in blank
hardFill all three blanks to read two numbers, add them, and print the result.
C Sharp (C#)
int num1 = int.Parse(Console.[1]()); int num2 = int.Parse(Console.[2]()); int sum = num1 [3] num2; Console.WriteLine($"Sum: {sum}");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Read reads only one character, not the full number.
Using other operators like - or * will change the result.
✗ Incorrect
Use ReadLine to read each number as text, then + to add them.