Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

Mt_rand ( ) function generates a random integer by using

A. Mersenne Twister algorithm
B. Divide and Conquer algorithm
C. Backtracking algorithm
D. Greedy Algorithm
Answer» B. Divide and Conquer algorithm
2.

PHP does automatic conversion of

A. Functions
B. Numerical types
C. Arrays
D. None of them
Answer» C. Arrays
3.

Mt_rand ( ) function produces a better random value, and is 4 times faster than

A. Assignment function
B. Boolean function
C. Comparison functions
D. rand ( ) function
Answer» E.
4.

Which operators have higher precedence?

A. Arithmetic operators
B. Comparison operators
C. Logical operators
D. Boolean operators
Answer» B. Comparison operators
5.

A simple mathematical function in PHP that takes a single argument and returns nearest integer, is a

A. round ( )
B. abs ( )
C. max ( )
D. floor ( )
Answer» B. abs ( )
6.

How many numerical types are allowed in PHP?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
7.

Decrement operator is denoted by

A. ++
B. −−
C. %%
D. ⁄⁄
Answer» C. %%
8.

A simple mathematical function in PHP that takes a single argument and returns largest integer that is less than or equal to that argument, is a

A. ceil ( )
B. abs ( )
C. max ( )
D. floor ( )
Answer» E.
9.

Numerical type in PHP is integer and

A. Strings
B. Unsigned short integer
C. Single-precisions
D. Double
Answer» E.
10.

Example of random number function is/are

A. strand ( )
B. getrandmax ( )
C. mt_rand ( )
D. All of them
Answer» E.
11.

Floating point numbers is also known as

A. long
B. Integers
C. Double
D. Character
Answer» D. Character
12.

Integers are also known as

A. Short integers
B. Double
C. floating point numbers
D. long
Answer» E.
13.

PHP will automatically convert strings to numbers when it needs to.~!

A. TRUE
B. FALSE
Answer» B. FALSE
14.

The result of below two statements will be:Round(2.5)Round(-2.5)~!

A. 2.5, -2
B. 2, -2
C. 3, -3
D. 3.5, -3.5
Answer» D. 3.5, -3.5
15.

If you do something to an integer that makes it larger than the maximum allowable integer or smaller than the minimum possible integer, the PHP interpreter converts the result into a . . . . .¬¨‚Ä~!

A. String
B. Floating point number
C. Integers
D. None of above
Answer» C. Integers
16.

In PHP the integer 45 is stored exactly as 45. The floating point number 46.3 could be stored as.%!

A. 46
B. 46.3
C. 46.2999999
D. none of above
Answer» D. none of above
17.

Ceil(-2.1) would be%!

A. 3
B. -3
C. -2
D. 2
Answer» D. 2
18.

PHP can automatically convert integers to floating point numbers and floating point numbers to integers.%!

A. TRUE
B. FALSE
Answer» B. FALSE
19.

Numbers in PHP can’t be infinitely large or small, there is some minimum and maximum size. If more larger (or smaller) numbers are needed then . . . . . must be used:1. GPM libraries2. GMP libraries3. CBMath4. BCMath%!

A. Option 2 and 4
B. Option 3 and 4
C. Option 1 and 4
D. Option 2 and 3
Answer» B. Option 3 and 4
20.

What will be the output of the following PHP code ?%!

A. qwe12345rty
B. qwe$arty
C. qwe
D. error
Answer» D. error
21.

The result of both the below expressions in PHP will be same:1) 3+4*22) (3+4)*2%!

A. TRUE
B. FALSE
Answer» C.
22.

What will be the output of the following PHP code ?%!

A. qwe12345rty
B. qwe{$a}rty
C. error
D. no output
Answer» C. error
23.

In order to find if a variable holds an actual number or a string containing characters that can be translated into a number you can use:%!

A. is_num()
B. is_number()
C. if_numeric
D. is_numeric()
Answer» E.
24.

What will be the output of the following PHP code ?%!

A. qwe12345rty
B. qwe$arty
C. error
D. no output
Answer» B. qwe$arty
25.

What is the output of given statement?Print 17 % 3;%!

A. 5.67
B. 2
C. 5.666667
D. none of above
Answer» C. 5.666667
26.

What will be the output of the following PHP code ?%!

A. 1.75
B. 0.875
C. 3.5
D. Error
Answer» C. 3.5
27.

What will be the output of the following PHP code ?%!

A. 0
B. Nothing
C. True
D. Error
Answer» C. True
28.

What will be the output of the following PHP code ?%!

A. Hello World
B. Bye
C. Hello worldBye
D. Error
Answer» B. Bye
29.

What will be the output of the following PHP code ?%!

A. 3
B. 4
C. 6
D. Error
Answer» E.
30.

What will be the output of the following PHP code ?%!

A. test
B. testtest
C. testvalue
D. error, constant value cannot be changed
Answer» D. error, constant value cannot be changed
31.

What will be the output of the following PHP code ?%!

A. $GREETING
B. no output
C. PHP is a scripting language
D. GREETING
Answer» C. PHP is a scripting language
32.

What will be the output of the following PHP code ?%!

A. 0
B. 1
C. 2
D. Error
Answer» C. 2
33.

What will be the output of the following PHP code ?%!

A. red1
B. red 1
C. 0
D. 1
Answer» E.
34.

What will be the output of the following PHP code ?%!

A. red green
B. red
C. green
D. error
Answer» E.
35.

What will be the output of the following PHP code ?%!

A. My car is a Volvo
B. My car is a BMW
C. My car is a Toyota
D. Error
Answer» B. My car is a BMW
36.

What will be the output of the following PHP code ?%!

A. qwe12345rty
B. qwe{$a}rty
C. error
D. no output
Answer» B. qwe{$a}rty
37.

What will be the output of the following PHP code ?%!

A. 1
B. no output
C. error
D. 0
Answer» C. error
38.

What will be the output of the following PHP code ?%!

A. 4hello4hello4hello4hello4hello…..infinite
B. 5hello5hello5hello5hello5hello…..infinite
C. no output
D. error
Answer» B. 5hello5hello5hello5hello5hello‚Äö√Ѭ∂..infinite
39.

What will be the output of the following PHP code ?%!

A. 1
B. 0
C. 2
D. no output
Answer» C. 2
40.

What will be the output of the following PHP code ?%!

A. no output
B. true 23
C. true 22
D. true 33
Answer» C. true 22
41.

What will be the output of the following PHP code ?%!

A. 000
B. 012
C. 123
D. Error
Answer» C. 123
42.

What will be the output of the following PHP code ?%!

A. 02
B. 12
C. 01
D. 21
Answer» B. 12
43.

What will be the output of the following PHP code ?%!

A. 20
B. true0
C. 0
D. true20
Answer» C. 0
44.

What will be the output of the following PHP code ?%!

A. 00000000000000000000….infinitely
B. -1-1-1-1-1-1-1-1-1-1…infinitely
C. no output
D. error
Answer» B. -1-1-1-1-1-1-1-1-1-1‚Äö√Ѭ∂infinitely
45.

*$_What will be the output of the following PHP code ??

A. 5
B. 10
C. 15
D. Error
Answer» D. Error
46.

*/*_What will be the output of the following PHP code ??

A. 0
B. 1
C. 2
D. Error
Answer» C. 2
47.

*/*_What will be the output of the following PHP code ??

A. test
B. testtest
C. testvalue
D. error, constant value cannot be changed
Answer» D. error, constant value cannot be changed
48.

*/*_What will be the output of the following PHP code ??

A. $GREETING
B. no output
C. PHP is a scripting language
D. GREETING
Answer» C. PHP is a scripting language
49.

*/*_What will be the output of the following PHP code ??

A. My car is a Volvo
B. My car is a BMW
C. My car is a Toyota
D. Error
Answer» B. My car is a BMW
50.

*/*_What will be the output of the following PHP code ??

A. Thiswasabadidea
B. Thiswasbadidea
C. Thiswas a badidea
D. Thiswas abadidea
Answer» C. Thiswas a badidea