What will be the output of the following C# code snippet? ```csharp int a = 5; if (a == 5) { Console.WriteLine("Equal"); } ```
Understanding C# Conditional Statements

Quiz
•
Computers
•
11th Grade
•
Easy
Emily Chard
Used 5+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
No output
Equal
Error
Not Equal
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following C# code: ```csharp int b = 10; if (b != 10) { Console.WriteLine("Not Equal"); } else { Console.WriteLine("Equal"); } ``` What will be printed?
Not Equal
Equal
Error
No output
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In C#, which of the following operators is used to check if two values are not equal?
==
!=
>
<
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code snippet? ```csharp int c = 15; if (c > 10) { Console.WriteLine("Greater"); } else { Console.WriteLine("Not Greater"); } ```
Greater
Not Greater
Error
No output
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following C# statements correctly checks if a variable `d` is less than or equal to 20?
if (d < 20)
if (d <= 20)
if (d == 20)
if (d >= 20)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C# code snippet? ```csharp int e = 25; if (e < 20) { Console.WriteLine("Less"); } else if (e == 25) { Console.WriteLine("Equal"); } else { Console.WriteLine("Greater"); } ```
Less
Equal
Greater
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a C# switch statement, which keyword is used to exit a case block?
exit
break
continue
stop
Create a free account and access millions of resources
Similar Resources on Quizizz
12 questions
Mod 4 quiz

Quiz
•
9th - 12th Grade
17 questions
CODE.ORG CSP UNIT 4 Boolean quiz#1

Quiz
•
9th - 12th Grade
21 questions
CodeHS 3.1 Boolean Expressions-4.2 For Loops Review

Quiz
•
9th - 12th Grade
15 questions
Basic Python Coding

Quiz
•
11th - 12th Grade
15 questions
FSWI - CH4 T1

Quiz
•
KG - Professional Dev...
11 questions
python basics

Quiz
•
9th - 12th Grade
20 questions
Conditionals Quiz

Quiz
•
9th - 12th Grade
20 questions
Mod 2 Test

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University