🔹MCQs Of Class 9: Forms in React
1. What does PHP stand for?
a)
Personal Home Page
b) Preprocessor Home Page
c) PHP: Hypertext Preprocessor
d) Private Home Page
Answer: c
2. Which function is used to connect
PHP with MySQL?
a)
mysql_connect()
b) mysqli_connect()
c) connect_db()
d) db_connect()
Answer: b
3. In PHP, which symbol is used to
declare a variable?
a)
#
b) @
c) $
d) &
Answer: c
4. Which of the following is NOT a
valid PHP data type?
a)
Integer
b) Float
c) Character
d) Boolean
Answer: c
5. What will the following PHP code
output?
php
CopyEdit
echo strlen("Hello");
a)
4
b) 5
c) 6
d) Error
Answer: b
6. Which HTML tag is used to create
a hyperlink?
a)
<a>
b) <link>
c) <href>
d) <hyperlink>
Answer: a
7. What is the correct way to
include an external CSS file in an HTML document?
a)
<style src="styles.css"></style>
b) <css href="styles.css">
c) <link rel="stylesheet" href="styles.css">
d) <script src="styles.css"></script>
Answer: c
8. In CSS, how do you select an
element with the id "header"?
a)
.header
b) #header
c) header
d) *header
Answer: b
9. Which CSS property is used to
change the text color?
a)
font-color
b) text-color
c) color
d) font-style
Answer: c
10. Which Laravel command is used to
create a new project?
a)
php artisan new projectname
b) laravel new projectname
c) composer create-project laravel/laravel projectname
d) php new laravel projectname
Answer: c
11. Which of the following is NOT a
HTTP method?
a)
GET
b) POST
c) DELETE
d) CONNECT
Answer: d
12. What is the default port number
for MySQL?
a)
3306
b) 8080
c) 1433
d) 80
Answer: a
13. Which HTML element is used to
define a table?
a)
<table>
b) <tr>
c) <td>
d) <tab>
Answer: a
14. Which function in PHP is used to
start a session?
a)
session_begin()
b) session_start()
c) start_session()
d) init_session()
Answer: b
15. In PHP, which function is used
to redirect to another page?
a)
redirect()
b) header()
c) goto()
d) link()
Answer: b
16. What does CSS stand for?
a)
Computer Style Sheets
b) Cascading Style Sheets
c) Creative Style Sheets
d) Colorful Style Sheets
Answer: b
17. How do you write a comment in
CSS?
a)
// comment
b) <!-- comment -->
c) /* comment */
d) # comment
Answer: c
18. What is the output of this PHP
code?
php
CopyEdit
echo 5 + "10 days";
a)
15
b) 5
c) 10 days
d) Error
Answer: a
19. What is the correct syntax to
create a function in PHP?
a)
function myFunction() { }
b) create function myFunction() { }
c) def myFunction() { }
d) func myFunction() { }
Answer: a
20. Which Laravel feature helps in
routing HTTP requests to the appropriate controller?
a)
Middleware
b) Blade
c) Routes
d) Controllers
Answer: c
21. Which operator is used to
concatenate strings in PHP?
a)
+
b) &
c) .
d) ,
Answer: c
22. Which HTML attribute is used to
define inline styles?
a)
class
b) style
c) css
d) font
Answer: b
23. Which PHP function converts a
string to uppercase?
a)
strtoupper()
b) strupper()
c) strtouppercase()
d) toUpper()
Answer: a
24. Which is the correct syntax to
write an IF statement in PHP?
a)
if (x > y) {}
b) if x > y {}
c) if x > y then {}
d) if (x > y) then {}
Answer: a
25. In Laravel, where do you define
database configuration?
a)
config/app.php
b) .env file
c) routes/web.php
d) database/config.php
Answer: b
26. What does AJAX stand for?
a)
Asynchronous JavaScript and XML
b) Asynchronous JSON and XML
c) Advanced JavaScript and XHTML
d) Asynchronous JavaScript and XHTML
Answer: a
27. Which of these is NOT a valid
HTML5 element?
a)
<article>
b) <section>
c) <frame>
d) <footer>
Answer: c
28. Which SQL command is used to
delete data from a table?
a)
REMOVE
b) DELETE
c) DROP
d) ERASE
Answer: b
29. How do you insert a comment in
PHP?
a)
// comment
b) # comment
c) /* comment */
d) All of the above
Answer: d
30. What is the purpose of Laravel’s
middleware?
a)
To send emails
b) To filter HTTP requests entering your application
c) To render views
d) To manage database migrations
Answer: b
31. Which tag is used to create an
unordered list in HTML?
a)
<ol>
b) <ul>
c) <li>
d) <list>
Answer: b
32. What will the following CSS rule
do?
css
CopyEdit
p {
color: blue;
}
a)
Make all paragraphs red
b) Make all paragraphs blue
c) Make all paragraphs bold
d) Hide all paragraphs
Answer: b
33. How to declare a constant in
PHP?
a)
const PI = 3.14;
b) define("PI", 3.14);
c) Both a and b
d) constant PI = 3.14;
Answer: c
34. Which Laravel command is used to
run database migrations?
a)
php artisan migrate
b) php artisan db:migrate
c) php migrate
d) composer migrate
Answer: a
35. What does SQL stand for?
a)
Simple Query Language
b) Structured Query Language
c) Strong Question Language
d) Standard Query Language
Answer: b
36. Which method sends data to a
server in an HTML form?
a)
POST
b) GET
c) Both a and b
d) PUT
Answer: c
37. What is the correct HTML element
for inserting a line break?
a)
<break>
b) <br>
c) <lb>
d) <line>
Answer: b
38. What is the default file
extension of PHP files?
a)
.html
b) .php
c) .ph
d) .phtml
Answer: b
39. Which PHP function checks if a
variable is set?
a)
isset()
b) empty()
c) isset()
d) check()
Answer: a
40. Which of the following is a PHP
superglobal array?
a)
$GLOBALS
b) $POST
c) $GET
d) All of the above
Answer: d
41. How do you create a checkbox in
HTML?
a)
<input type="checkbox">
b) <checkbox>
c) <input type="check">
d) <check>
Answer: a
42. Which JavaScript keyword
declares a variable?
a)
var
b) let
c) const
d) All of the above
Answer: d
43. In Laravel, what does the artisan
command do?
a)
Manage routes
b) Perform command-line tasks such as migrations and controllers generation
c) Handle database connections
d) Deploy the app
Answer: b
44. Which tag is used to display a
picture in HTML?
a)
<image>
b) <img>
c) <pic>
d) <src>
Answer: b
45. Which CSS property is used to
control the size of text?
a)
font-size
b) text-size
c) size
d) font-style
Answer: a
46. Which function is used to fetch
a row from a MySQLi result set in PHP?
a)
mysqli_fetch_assoc()
b) fetch_row()
c) get_row()
d) mysql_fetch_row()
Answer: a
47. Which is the correct way to
start a PHP script?
a)
<php
b) <?php
c) <script php>
d) <?
Answer: b
48. What will the following SQL
query do?
sql
CopyEdit
SELECT * FROM students WHERE age >
18;
a)
Select all students aged 18
b) Select all students older than 18
c) Select students younger than 18
d) Delete students older than 18
Answer: b
49. Which method in JavaScript is
used to add an element at the end of an array?
a)
push()
b) pop()
c) shift()
d) unshift()
Answer: a
50. What is the output of the
following PHP code?
php
CopyEdit
echo 10 % 3;
a)
3
b) 1
c) 0
d) 10
Answer: b
