Back to dashboard

Reading mode

Unit 3: Programming Fundamentals

Correct answer is shown on each question. Use Next to read one by one.

Question 1 of 40 0% read

1. Which language is used to define the structure and content of a web page?

A CSS
B JavaScript
C HTML
D Python

2. Which CSS property is used to change text color?

A font-style
B text-color
C color
D background-color

3. What is a set of step-by-step instructions for a computer to solve a problem called?

A An algorithm
B A variable
C A syntax
D A comment

4. Which tool in a web browser helps developers see errors and messages from their JavaScript code?

A The address bar
B The console
C The settings menu
D The history tab

5. What is the main purpose of an algorithm?

A Store data
B Design webpages
C Solve a problem step by step
D Write HTML code

6. Which JavaScript statement stops a loop?

A stop
B exit
C break
D end

7. Which CSS property is used to align text?

A align
B text-align
C font-align
D position

8. Which HTML tag is used to collect user input?

A <form>
B <input>
C <textarea>
D <button>

9. Which JavaScript function displays a message box?

A prompt()
B confirm()
C alert()
D message()

10. Which HTML tag is used to create a table row?

A <td>
B <th>
C <tr>
D <table>

11. Which sorting algorithm repeatedly swaps adjacent elements?

A Selection sort
B Insertion sort
C Bubble sort
D Merge sort

12. Which CSS property controls the size of text?

A text-size
B font-weight
C font-size
D text-style

13. What is the output of a Boolean expression?

A Number
B String
C True or False
D Character

14. Which CSS property is used to change the background color of an element?

A color
B bgcolor
C background-color
D background-style

15. Which algorithm compares each element with all others?

A Binary search
B Linear search
C Quick sort
D Merge sort

16. Which HTML tag is used to create a link to another web page?

A <link>
B <img>
C <p>
D <a>

17. In HTML5, which tag is used to define a footer for a document or a section?

A <bottom>
B <footer>
C <end>
D <section>

18. Which testing method checks individual units of code?

A System testing
B Integration testing
C Unit testing
D Acceptance testing

19. Which JavaScript operator is used to compare both value and type?

A ==
B =
C ===
D !=

20. Which JavaScript statement is used for decision making?

A switch
B if
C else
D All of these

21. Which loop is used when the number of iterations is known?

A while
B do-while
C for
D foreach

22. Which JavaScript console method is used for debugging?

A console.write()
B console.debug()
C console.log()
D console.print()

23. Which HTML tag is used to create a hyperlink?

A <link>
B <a>
C <href>
D <url>

24. Which HTML tag is used to display an image on a webpage?

A <image>
B <img>
C <pic>
D <src>

25. What is an error in the code's grammar or spelling called?

A Runtime error
B Logical error
C Syntax error
D User error

26. Which algorithm searches an element by dividing the list into halves?

A Linear search
B Bubble sort
C Binary search
D Selection sort

27. Which tool is used to find errors in a program?

A Compiler
B Debugger
C Interpreter
D Editor

28. What will the `console.log(typeof "Hello")` command show in the JavaScript console?

A number
B boolean
C object
D string

29. In JavaScript, which keyword is used to declare a variable that can be changed later?

A let
B const
C var
D variable

30. Which CSS property controls element positioning?

A float
B position
C display
D align

31. What is the process of finding and fixing errors in a computer program called?

A Compiling
B Executing
C Debugging
D Designing

32. Which HTML tag is used to create an unordered list?

A <ol>
B <ul>
C <li>
D <list>

33. Which CSS pseudo-class is used to select and style an element when you move your mouse over it?

A :hover
B :active
C :focus
D :link

34. Which debugging technique involves checking output step by step?

A Dry run
B Tracing
C Testing
D Compilation

35. Which error occurs due to wrong logic in a program?

A Syntax error
B Runtime error
C Logical error
D System error

36. Which algorithm gives the best result in minimum steps?

A Efficient algorithm
B Long algorithm
C Simple algorithm
D Manual algorithm

37. Which JavaScript structure can store key-value pairs?

A Array
B Object
C Function
D Loop

38. Which tool in a web browser is most commonly used by developers to find and fix errors in JavaScript code?

A The browser's console
B The history tab
C The settings menu
D The bookmarks bar

39. Which HTML section contains metadata?

A <body>
B <meta>
C <head>
D <title>

40. What is the main purpose of CSS (Cascading Style Sheets)?

A To add interactivity to a website.
B To store data for a website.
C To create the structure of a website.
D To control the visual style and layout of a website.

You finished reading all questions

Try practice mode to check answers without scoring, or play for a scored attempt.