0
0
C Sharp (C#)programming~10 mins

What is C# - Interactive Quiz & Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print "Hello, World!" in C#.

C Sharp (C#)
using System;

class Program {
    static void Main() {
        Console.[1]("Hello, World!");
    }
}
Drag options to blanks, or click blank then click option'
ADisplay
BPrint
COutput
DWriteLine
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods like Print or Display which do not exist in C# Console class.
2fill in blank
medium

Complete the code to declare an integer variable named 'age' with value 25.

C Sharp (C#)
int [1] = 25;
Drag options to blanks, or click blank then click option'
Aage
Bvalue
Cnumber
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like number or value instead of 'age'.
3fill in blank
hard

Fix the error in the code to correctly declare a string variable with value "C#".

C Sharp (C#)
string language = [1]C#[1];
Drag options to blanks, or click blank then click option'
A`
B"
C'
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes which are for characters, not strings.
4fill in blank
hard

Fill the blank to create a simple if statement that checks if number is greater than 10.

C Sharp (C#)
if (number [1] 10) {
    Console.WriteLine("Number is greater");
}
Drag options to blanks, or click blank then click option'
A!=
B<
C>
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using < or == which do not check for greater than.
5fill in blank
hard

Fill all three blanks to declare a list of integers and add the number 5 to it.

C Sharp (C#)
List<int> numbers = new [1]<int>();
numbers.[2](5);
Console.WriteLine(numbers.[3]);
Drag options to blanks, or click blank then click option'
AList
BAdd
CCount
DArray
Attempts:
3 left
💡 Hint
Common Mistakes
Using Array instead of List.
Using wrong method names like Insert instead of Add.
Using Length instead of Count for List.