C# Operators

C# Operators

10th Grade

25 Qs

quiz-placeholder

Similar activities

CodeHS JavaScript Control Functions

CodeHS JavaScript Control Functions

9th - 12th Grade

20 Qs

JavaScript Intro

JavaScript Intro

10th - 12th Grade

24 Qs

AP CSP Unit 6

AP CSP Unit 6

10th - 12th Grade

20 Qs

Module 04 - If Statements

Module 04 - If Statements

10th Grade

20 Qs

iGCSE Computer Science: Boolean Logic

iGCSE Computer Science: Boolean Logic

9th - 12th Grade

20 Qs

Visual Basic Ch.5 Loops

Visual Basic Ch.5 Loops

9th - 12th Grade

20 Qs

CodeHS JavaScript

CodeHS JavaScript

8th - 12th Grade

21 Qs

Python Interaction

Python Interaction

9th Grade - Professional Development

20 Qs

C# Operators

C# Operators

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Michael Atienza

Used 12+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

You are writing a program to determine if a user's input int age is eligible for a senior discount (age 60 or older). Which of the following conditions would you use?

age > 59

age >= 60

age == 60

age < 60

2.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

You have two variables int x = 10; and int y = 5;. You want to check if x is greater than twice the value of y. Which of the following expressions should you use?

x > 2 * y

x == 2 * y

x < 2 * y

x >= 2 * y

3.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

  1. You are developing a program to compare two strings string str1 and string str2. You want to check if str1 is lexicographically greater than str2. Which of the following expressions would you use?

str1 > str2

str1 == str2

str1 < str2

str1 != str2

4.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

You have a boolean variable bool isRainy = true; and want to check if it's not raining. Which of the following expressions should you use?

isRainy

!isRainy

isRainy == true

isRainy != false

5.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

You are validating user input for a positive integer int num. You want to ensure that num is greater than zero. Which of the following conditions would you use?

num >= 0

num == 0

num < 0

num > 0

6.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

In a game, you want to check if the player's score int playerScore is at least 100 points to qualify for the next level. Which of the following conditions should you use?

playerScore > 100

playerScore >= 100

playerScore == 100

playerScore < 100

7.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

You have two variables double price = 25.50; and double budget = 50.00;. You want to check if the price is within the budget. Which of the following expressions should you use?

price == budget

price >= budget

price > budget

price <= budget

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?