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
What will be the output of the following C# code snippet? ```csharp int a = 5; if (a == 5) { Console.WriteLine("Equal"); } ```
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 Wayground
14 questions
TechSmart Unit 1 Vocabulary Text

Quiz
•
9th - 11th Grade
21 questions
Unit 4 Review (AP CSP)

Quiz
•
9th - 12th Grade
15 questions
AP CSP Unit 4

Quiz
•
10th - 12th Grade
18 questions
Pemrograman C++ (Dasar)

Quiz
•
11th Grade
15 questions
Python Basics

Quiz
•
KG - University
16 questions
An introduction to Arduino

Quiz
•
10th - 11th Grade
12 questions
Arrays Intro

Quiz
•
9th - 12th Grade
15 questions
Python Basics Quiz 1

Quiz
•
8th Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade