Sunday, January 7, 2018

PHP Sample Test Paper

PHP Online Test Quiz. PHP Test Papaer MCQ.

PHP Sample Test Quiz

1. What do PHP stand for?

Personal Hypertext Preprocessor
Pretext Hypertext Processor
Hypertext Processor
None

2. A PHP code should put butween?

<php> and </php>
<?php and ?>
<? and ?>
<?php and php?>

3. Which version of PHP introduced Try/catch Exception?

PHP 5
PHP 6
PHP 7
PHP 4

4. What extension is used for PHP code file?

.html
.ht
.php
.ph

5. Which of the statement will store value 111 in a PHP variable name num?

int $num = 111;
int num = 111;
integer num = 111;
$num = 111;

6. How to create a function in PHP?

function test()
function=test()
function:test()
function::test()

7. How to call a function named "test" in PHP?

function test()
call test()
test()
call function test()

8. How to comment/comment code in PHP?

//my comment
'my comment
<--my comment-->
/my comment/

9. How to declare a variable in PHP?

$myvar;
var $myvar;
var myvar;
variable $myvar;

10. Which attribute is used to use a global variable in PHP?

scope
glob
global
None

11. Which one is used to new line in PHP?

\n
/n
\r
/r

12. A function in PHP which starts with double underscore is known as?

Inbuilt funcion
Magic function
User defined function
Default function

13. Which version of PHP introduced Type hinting?

PHP 4
PHP 5
PHP 6
PHP 7

14. Which is the valid function name in PHP?

$function()
.function()
#()
function()

15. Which of the following is not a valid PHP variable name?

_varname
2varname
varname
None

16. Which language is used to server side validation of a web page?

PHP
HTML
CSS
XML

17. How to write for loop in PHP?

for($i=0; $i<=10; ++$i)
for i=10 then iterate
for each (i<=10)
for(i=0; i<=10; ++i)

18. Which of the following is correct way to write "Hello World" on the screen?

echo("Hello World");
print("Hello World");
out.print("Hello World");
document.write("Hello World");

19. Which will print $x on the screen?

echo "$x";
echo "\$x";
echo "$$x";
echo "/$x";

20. Which statement is equivalent to $x += $x ?

$x = $x;
$x = $x + $x + 1;
$x = $x + $x;
$x = $x + 1;



Friday, January 5, 2018

Java Script Sample Test Paper

Java Script Online Test Quiz. Javascript Test Paper

Javascript Sample Test Quiz

1. What is Javascript?

Programming language
Application language
Scripting language
None

2. Which HTML element is used to put Javascript code?

<scripting>
<script>
<javascript>
<js>

3. What extension is used for Javascript code file?

.js
.jsc
.javas
.javascript

4. What is the correct syntax for refering external Javascript code file?

<script href="external.js">
<script name="external.js">
<script src="external.js">
<script ref="external.js">

5. How to popup a message in Javascript?

msgbox("my message");
msg("my message");
message("my message");
alert("my message");

6. How to create a function in Javascript?

function test()
function=test()
function:test()
function::test()

7. How to call a function named "test" in Javascript?

function test()
call test()
test()
call function test()

8. How to comment/comment code in Javascript?

//my comment
'my comment
<--my comment-->
/my comment/

9. How to declare a variable in Javascript?

myvar;
var myvar;
v myvar;
variable myvar;

10. Which attribute changed to make elements invisible?

invisibility
invisible
visible
visibility

11. Which statement is true about Javascript?

Javascript is case sensitive
Javascript statements can be grouped together in blocks
javascript is compiler based
None

12. What is the event that fires when the form elements loses the focus?

Onloose
Onblur
Onclick
onfocus

13. Which attribute is used to hold the Javascript version information?

VERSION
VER
LANGUAGE
SCRIPT

14. Which of the below is used in Javascript to insert special characters?

@
*
%
&

15. Which of the following is not a valid Javascript variable name?

_varname
2varname
varname
None

16. Which language define the behavior of a web page?

Javascript
HTML
CSS
XML

17. How to write for loop in Javascript?

for(i=0; i<=10; ++i)
for i=10 then iterate
for each (i<=10)
None

18. Which of the following is correct way to write "Hello World" on the web page?

print("Hello World")
System.print("Hello World")
out.print("Hello World")
document.write("Hello World")

19. How to get the id of a form element?

getId
getElementById
getElementId
None

20. How to create a date object in Javascript?

var d = new toDate();
var d = new getDate();
var d = new Date();
var d = Date();