MCQs — Programming Fundamentals

Practice questions for Computer Science.

Question 41

Which tag inserts a line break in HTML?

A. <lb>
B. <hr>
C. <br>
D. <nl>
Question 42

Which tag is used to create a paragraph?

A. <para>
B. <pg>
C. <h1>
D. <p>
Question 43

What is special about the
tag?

A. It must be written inside the head
B. It has no closing tag
C. It changes the text to bold
D. It can be used only once on a page
Question 44

Which code displays the word Hello in bold?

A. <b>Hello</b>
B. <i>Hello</i>
C. <b>Hello<b>
D. <br>Hello</br>
Question 45

Which pair of tags makes text bold and italic respectively?

A. <i> and <b>
B. <u> and <b>
C. <b> and <i>
D. <br> and <i>
Question 46

Which tag is used to display an image on a web page?

A. <image>
B. <pic>
C. <src>
D. <img>
Question 47

Which attribute of the tag gives the file name of the image?

A. src
B. alt
C. href
D. name
Question 48

What is the purpose of the alt attribute in the tag?

A. It sets the position of the image on the page
B. It gives text that is shown if the image cannot be displayed
C. It gives the file name of the image
D. It changes the image into a link
Question 49

Which code correctly displays the picture file logo.png?

A. <img href="logo.png">
B. <image src="logo.png">
C. <img src="logo.png">
D. <img "logo.png">
Question 50

Which statement about the tag is correct?

A. It is an empty tag and has no closing tag
B. It must always be closed with </img>
C. It can only be used inside the head
D. It is used to write headings
Question 51

Which tag creates a bulleted list?

A. <ol>
B. <ul>
C. <li>
D. <bl>
Question 52

Which tag creates a numbered list?

A. <ul>
B. <li>
C. <nl>
D. <ol>
Question 53

Which tag is used for each item inside a list?

A. <ul>
B. <ol>
C. <li>
D. <item>
Question 54

What is the difference between

    and

      ?

A. <ul> creates bullets, while <ol> creates numbers
B. <ul> creates numbers, while <ol> creates bullets
C. <ul> creates a table, while <ol> creates a link
D. There is no difference between them
Question 55

Which code shows a numbered list with two items, Red and Blue?

A. <ul><li>Red</li><li>Blue</li></ul>
B. <ol><li>Red</li><li>Blue</li></ol>
C. <ol>Red Blue</ol>
D. <li><ol>Red</ol><ol>Blue</ol></li>
Question 56

Which tag creates a table in HTML?

A. <tab>
B. <tbl>
C. <tr>
D. <table>