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

Explicit value assignment in C Sharp (C#) - Interactive Code Practice

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

Complete the code to assign the value 10 to the variable.

C Sharp (C#)
int number = [1];
Drag options to blanks, or click blank then click option'
A10
B"10"
Cten
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers which makes them strings.
Using words like 'ten' instead of numeric values.
2fill in blank
medium

Complete the code to assign the character 'A' to the variable.

C Sharp (C#)
char letter = [1];
Drag options to blanks, or click blank then click option'
A"A"
B65
C'A'
DA
Attempts:
3 left
💡 Hint
Common Mistakes
Using double quotes which makes it a string.
Using the character without quotes.
3fill in blank
hard

Fix the error in assigning a boolean value to the variable.

C Sharp (C#)
bool isActive = [1];
Drag options to blanks, or click blank then click option'
A"true"
BTrue
C1
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase True which is invalid in C#.
Using quotes which makes it a string.
Using numbers like 1 instead of true.
4fill in blank
hard

Fill both blanks to assign a floating-point number and a string correctly.

C Sharp (C#)
float pi = [1]f;
string greeting = [2];
Drag options to blanks, or click blank then click option'
A3.14
B"Hello"
CHello
D3,14
Attempts:
3 left
💡 Hint
Common Mistakes
Using comma instead of dot for decimals.
Not adding 'f' suffix for float values.
Not using quotes for strings.
5fill in blank
hard

Fill all three blanks to assign an integer, a boolean, and a string correctly.

C Sharp (C#)
int count = [1];
bool isReady = [2];
string message = [3];
Drag options to blanks, or click blank then click option'
Afalse
Btrue
C"Done"
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around booleans.
Using words instead of numbers for integers.
Not using quotes for strings.