Basic C# Programming Quiz

Quiz
•
Computers
•
9th Grade
•
Medium
Used 3+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to declare an integer variable in C#?
int number;
integer number;
num number;
var number = "int";
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default value of a string variable in C# if it is not initialized?
0
null
""
"undefined"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which data type would you use to store a value like 3.14 in C#?
int
string
double
bool
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? ```csharp int x = 5; int y = 2; Console.WriteLine(x + y); ```
7
52
3
10
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid way to assign a value to a property named `Text` of a label called `label1` in a Windows Form?
label1.Text = "Hello";
label1->Text = "Hello";
label1.text("Hello");
label1.Text: "Hello";
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to declare a variable whose value cannot be changed after initialization in C#?
static
const
var
readonly
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to convert an integer variable `num` to a string in C#?
num.ToString();
ToString(num);
string(num);
num.toString;
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
App Creator 1.7

Quiz
•
7th - 9th Grade
15 questions
Python Data Types

Quiz
•
9th - 10th Grade
18 questions
National 4/5 Programming (VB)

Quiz
•
9th - 11th Grade
20 questions
Data Type

Quiz
•
7th - 12th Grade
16 questions
STM30243 - TOPIC 4

Quiz
•
9th Grade
12 questions
N5 SDD - Python input and output

Quiz
•
7th - 11th Grade
16 questions
SUMATIF 1 ANALISIS DATA

Quiz
•
8th Grade - University
17 questions
Python Modulus & Exponent & If 305

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade