
CSC603 Demorgan Law and If statement

Quiz
•
Computers
•
11th Grade
•
Hard

Arwa Hassan
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to write an if statement in Java?
if x > 10
then
{
System.out.println("x is greater than 10");
}
if (x > 10)
{
System.out.println("x is greater than 10");
}
if x > 10:
System.out.println("x is greater than 10");
if (x > 10)
System.out.println("x is greater than 10")
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
int a = 5;
if (a == 5)
System.out.println("A is 5");
else
System.out.println("A is not 5");
No output
A is not 5
A is 5
Compilation error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following if statement check?
if (x >= 0 && x <= 10)
If x is less than 0 or greater than 10
If x is greater than or equal to 0 and less than or equal to 10
If x is equal to 0 or 10
If x is not equal to 0 or 10
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this code?
int a = 10;
if (a == 5)
System.out.println("Output 1 );
else if (a > 5)
System.out.println(" Output 2 ");
else System.out.println("Output 3");
Output 1
output 2
output 3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct negation of the expression !(a || b) using De Morgan's Law?
a && b
!a && !b
a || !b
!a || !b
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Using De Morgan's Law, what is the negation of the condition (x < 5) && (y >= 7)?
(x >= 5) || (y < 7)
(x > 5) || (y > 7)
(x < 5) || (y < 7)
(x >= 5) && (y < 7)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of applying De Morgan's Law to the expression
!(x > 10 && y < 20)?
(x <= 10) || (y >= 20)
(x < 10) && (y > 20)
(x >= 10) || (y <= 20)
(x <= 10) && (y >= 20)
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is equivalent to
!(a && b)?
a || !b
!a || !b
!a && !b
a && b
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If x and y are booleans, which of the following is equivalent to !(x || y) using De Morgan's Law?
x && y
!x && !y
!x || !y
x || y
Similar Resources on Wayground
10 questions
Arrays

Quiz
•
10th - 12th Grade
14 questions
CSAwesome 3.6.1Equivalent Boolean Expressions

Quiz
•
9th - 12th Grade
11 questions
HTML Tags (Basic) Quiz

Quiz
•
11th - 12th Grade
8 questions
Quiz P2

Quiz
•
9th Grade - University
10 questions
AP Computer Science-Quiz 2(G10)

Quiz
•
9th - 12th Grade
10 questions
Java String class methods

Quiz
•
10th - 12th Grade
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
13 questions
PHP & MySQL - 04

Quiz
•
11th - 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