
C# Programming Challenge

Quiz
•
Computers
•
12th Grade
•
Hard
Златомира Карагьозова
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the basic data types available in C#?
byte, short, long, array
integer, decimal, character, boolean
text, number, symbol, list
int, float, double, char, bool, string, object
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the purpose of 'if' and 'switch' statements in C#.
The 'if' statement is only for error handling, and the 'switch' statement is for input validation.
The 'if' statement is used for looping through arrays, while the 'switch' statement is for defining functions.
The 'if' statement executes code based on a condition, while the 'switch' statement selects code to execute based on the value of a variable.
Both 'if' and 'switch' statements are used to declare variables in C#.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a class and an object in C#?
A class can only contain methods; an object can only contain data.
A class is a blueprint for creating objects; an object is an instance of a class.
A class is an instance of an object; an object is a blueprint for classes.
A class is a type of object; an object is a collection of classes.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Define recursion and provide an example in C#.
Recursion is a technique for managing memory allocation in C#.
Here is an example of a recursive function in C# that calculates the factorial of a number: int Factorial(int n) { if (n <= 1) return 1; // Base case return n * Factorial(n - 1); // Recursive case }
A recursive function in C# is one that uses loops instead of calls.
Recursion is a method of sorting arrays in C#.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a loop and what types of loops are available in C#?
for each, until, repeat until
loop, cycle, traverse
Types of loops in C#: for, foreach, while, do while.
repeat, iterate, loop through
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare an array in C#?
myArray: int[];
int[] myArray;
int myArray[];
array myArray int[];
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the significance of constructors in object-oriented programming?
Constructors can be used to create static methods.
Constructors are only necessary for abstract classes.
Constructors are significant because they initialize objects and ensure they are in a valid state upon creation.
Constructors are used to delete objects after they are created.
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
C# Arrays

Quiz
•
9th - 12th Grade
10 questions
IT English Essentials: Unit 13 - Quiz 1

Quiz
•
12th Grade
6 questions
Java array

Quiz
•
11th Grade - University
15 questions
Java Level 1 - C

Quiz
•
12th Grade
12 questions
Computer Application ISC

Quiz
•
12th Grade
15 questions
JAVA: Level-1

Quiz
•
5th - 12th Grade
10 questions
Laboratorio II

Quiz
•
12th Grade
10 questions
Unit 23 - Pop Quiz

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade