Lesson details
Key learning points
- In this lesson, we will be introduced to a new operator called XOR. We will discover how an XOR works before writing a function to perform the XOR operation.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
5 Questions
Q1.
On which line is the global variable number assigned?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707171102%2Fqijis8cvwoy3z7n2uqgv.png&w=1200&q=75)
1
2
6
Q2.
On which line is the local variable number assigned?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707171107%2Fu875u3bwfur0qevldvw8.png&w=1200&q=75)
1
5
6
Q3.
What value will line 8 output when this program is executed?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707171114%2Fvy89nyjjkobqjiomnkt5.png&w=1080&q=75)
10
5
There will be no output
Q4.
What will happen when this program is executed?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707171123%2Fvlrx9tjg2h8ueredzj9l.png&w=1080&q=75)
An error message because the global variable number is not defined
It will output 10
It will output 5
Q5.
On which line of code does constant declaration occur?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707171129%2Fdnayg33tmglmnjcyxkmh.png&w=750&q=75)
1
2
4
4 Questions
Q1.
What will be the output when this program is executed?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157927%2Fqsgt0ecoanbbtnslcsza.png&w=640&q=75)
That is false, That is false
That is false, That is true
That is true, That is false
Q2.
Will the following program output True or False?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157945%2Frywt1e3rrrar7ynyvzpz.png&w=1200&q=75)
False
Q3.
Will the following program output True or False?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157957%2Ftbyqwvkogyexfi3oetgr.png&w=1200&q=75)
True
Q4.
Will the following program output True or False?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157961%2Fhhwxum46otcgzv2gg30b.png&w=1200&q=75)
False