Saturday, February 13, 2021

Visual Basic .NET (VB.NET) Mcq Question Answer Part - 6

Question: 1. Only derived class can have shadows keyword

Option A. True
Option B. False

Question: 2. For the same class "Me" and MyBase" are same
Option A. True
Option B. False

Question: 3. If you want to open a file named "a.txt" use
Option A. System.diagnostics.Start("a.txt")
Option B. System.Start("a.txt")
Option C. System.diagnostics.Process.Start("a.txt")
Option D. System.Process.Start("a.txt")

Question: 4. _________ actually updates the values in a DataSet permanently
Option A. OleDataAdapterq1.update(DataSet1,"emp")
Option B. DataSet1.Merge(DataSet1)
Option C. DataSet1.AcceptChanges()
Option D. DataSet1.Update()

Question: 5. /*1. OleDataAdapterq1.update(DataSet1,"emp")
2. OleDataAdapterq1.update(DataSet1,"std")
3. DataSet1.Merge(DataSet1)
4. DataSet1.AcceptChanges()
/* The error is in line
Option A. 2
Option B. 4
Option C. 3
Option D. No Error

Question: 6. Using ADODB multiple tables can be connected at a time
Option A. True
Option B. False

Question: 7. A DataSet can be updated only when the connection is open
Option A. True
Option B. False

Question: 8. To redimension an array with its previous values intact use ___________ keyword
Option A. RedimPreserve
Option B. Preserve
Option C. Redim
Option D. Redim Preserve

Question: 9. _________ and _____________ combines to make a KeyPress event
Option A. KeyUp, KeyDown
Option B. KeyEnter, KeyRelease
Option C. KeyDown, KeyRelease
Option D. KeyEnter, KeyUp

Question: 10. To retrieve the default path of the project use
Option A. Application.Path
Option B. Application.DefaultPath
Option C. Application.StartupPath
Option D. Application.ProjectPath

Question: 11. Application.StartupPath actually points to
Option A. //ProjectName
Option B. //ProjectName/Bin
Option C. //ProjectName/Debug
Option D. //ProjectName/Bin/ProjectName.exe

Question: 12. A form can not call itself
Option A. True
Option B. False

Question: 13. If a form call another form and the caller form is closed through code, then both forms are disposed
Option A. True
Option B. False

Question: 14. When a project is Built it creates a _______ and ________ file under Bin directory
Option A. .exe, .sln
Option B. .exe, .dll
Option C. .dll, .sln
Option D. .exe, .ocx

Question: 15. The EventLog's ________ method is used to write an entry to a log file
Option A. WriteLine
Option B. WriteEntry
Option C. Add
Option D. Append

Question: 16. A form can have only one default button
Option A. True
Option B. False

Question: 17. If a button click event is to be fired when the user press the 'Esc' key, set the buttons name against forms _________ property
Option A. DefaultButton
Option B. AcceptButton
Option C. DialogResult
Option D. CancelButton

Question: 18. If nothing is selected in a combo box, its index value is
Option A. -1
Option B. 0
Option C. 1
Option D. Null

Question: 19. A Windows Service if installed cannot be uninstalled
Option A. True
Option B. False

Question: 20. To uninstall a Windows Service ____________ is use
Option A. Installutil -I
Option B. Installutil -e
Option C. Installutil -u
Option D. Installutil -d

Answer Sheet

1A
2A
3C
4C
5D
6B
7B
8D
9A
10C
11B
12B
13A
14B
15B
16A
17D
18A
19B
20C

VB.NET MCQ Question Answer Part - 5

Question: 1. PasswordChar property of a TextBox can accept " " (space) as the password char

Option A. True
Option B. False

Question: 2. If Scrollbars property of a TextBox is set to Hortizontal and the WordWrap property is also set to true. Which one will get precedence
Option A. Scrollbars
Option B. WordWrap
Option C. No precedence both will work

Question: 3. A single LinkLabel can support multiple links
Option A. True
Option B. False

Question: 4. To add items stored in an array to a ListView use
Option A. List1.Add(name of the array)
Option B. List1.AddItem(name of the array)
Option C. List1.Items.Add(name of the array)
Option D. List1.Items.Addrange(name of the array)

Question: 5. This property of TrackBar is not present
Option A. TickStyle.Both
Option B. TickStyle.None
Option C. TickStyle.TopLeft
Option D. TickStyle.BottomLeft

Question: 6. Default event handler of Splitter is
Option A. Splitter.Click
Option B. Splitter.Clicked
Option C. Splitter.Drag
Option D. None of the above

Question: 7. A form can have only ______ Main Menu and _________ Context Menu
Option A. 1,1
Option B. 1,Multiple
Option C. Multiple,1
Option D. 1,2

Question: 8. The Apply button automatically appears of the Font Dialog Box is opened
Option A. True
Option B. False

Question: 9. A user wants that custom colors are visible when the Color Dialog Box is first Opened. What should he do?
Option A. Set AllowFullOpen to True
Option B. Set AnyColor to True
Option C. Set Open to True
Option D. Set FullOpen to True

Question: 10. To print use
Option A. PrintDialog1.Print()
Option B. PrintDocument1.Print()
Option C. Printer1.Print()
Option D. None of the above

Question: 11. In TreeView to get the node the mouse is pointing to, use
Option A. GetNode
Option B. Node
Option C. GetNodeAt
Option D. SelectNode

Question: 12. A TreeView can have multiple root nodes
Option A. True
Option B. False

Question: 13. To view Panels of a StatusBar set _________ to true
Option A. Panel
Option B. Panels
Option C. ShowPanel
Option D. ShowPanels

Question: 14. The default Tab of a Tab Control is
Option A. The first tab
Option B. The last tab added
Option C. The last tab modified
Option D. There is no default tab.

Question: 15. If a Class in inherited, its constructor is inherited automatically and it is fired automatically
Option A. True
Option B. False

Question: 16. To override Finalize function the scope of the function must be
Option A. Private
Option B. Public
Option C. Protected
Option D. Static

Question: 17. Class cc
public _________ I as string
end class
Button1_Click
cc.I=100
Option A. Share
Option B. Shared
Option C. Global
Option D. Static

Question: 18. If an user-defined class have a user-defined event then, the class object is declared as
Option A. Dim c as new ClassName
Option B. Dim withEvents c as new ClassName
Option C. Dim c as ClassName
Option D. Dim withEvents c as ClassName

Question: 19. /*1. Class C
2. public mustinherit sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The error is in line no.
Option A. 1
Option B. 2
Option C. 3
Option D. 4

Question: 20. /*1. Class C
2. public notoverridable sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The Error in Line No.
Option A. 2
Option B. 3
Option C. 4
Option D. No Error

Answer Sheet

1B
2B
3A
4D
5D
6D
7B
8B
9D
10B
11C
12A
13D
14A
15A
16C
17B
18B
19A
20A

VB.NET New MCQ Question Answer Part-4

 

Question: 1. DataSet can be used to connect to Crystal Report

Option A. True
Option B. False

Question: 2. dim arr(10) as string,
the max index of the array is
Option A. 9
Option B. 10
Option C. Can be >10 also
Option D. None of the above

Question: 3. Use a _________ statement to make Visual Basic object the default object for a set of enclosed Visual Basic statements.
Option A. With
Option B. Using
Option C. Import
Option D. Inherit

Question: 4. If Option Explicit is on then Dim i as Integer="10" will produce an error
Option A. True
Option B. False

Question: 5. Dim a() as Integer-{1,2,3,4}is a valid statement
Option A. True
Option B. False

Question: 6. ___________ is used to pass copies of a variable while __________ is used to pass address of a variable.
Option A. Byval, Byref
Option B. Byref, Byval
Option C. Any one of the above
Option D. None of the above

Question: 7. A function can have multiple return statements
Option A. True
Option B. False

Question: 8. Function abc() As String
Return 10
End Function
Option A. Will produce compilation error
Option B. Will produce runtime error
Option C. The function will execute normally
Option D. None of the above

Question: 9. On error goto lbl is a
Option A. Structured error
Option B. Unstructured error

Question: 10. To get details about an error use
Option A. Err.Message
Option B. Err.Desc
Option C. Err.Description
Option D. Err.Number

Question: 11. Finally is fired only when error occurs
Option A. True
Option B. False

Question: 12. Get method is used to
Option A. Assign a value to an user control
Option B. Read value from an user control
Option C. Both of the above
Option D. None of the above

Question: 13. Set method is used to
Option A. Assign a value to an user control
Option B. Read value from an user control
Option C. Both of the above

Question: 14. The correct sequence of Form Loading is
Option A. Load
Option B. Initialize, Load, Activate
Option C. Initialize, Activate, Load
Option D. Activate, Initialize Load

Question: 15. InputBox by default returns ________ values
Option A. Integer
Option B. Byte
Option C. Double
Option D. String

Question: 16. To add controls at runtime use
Option A. Controls.New
Option B. Controls.AddNew
Option C. Controls.Add
Option D. Controls.AddItem

Question: 17. To call a buttons click event use
Option A. Button1.Click
Option B. Button1.PerformClick
Option C. Button1.Clicked
Option D. None of the above

Question: 18. To vertically arrange all forms in an MDI form use
Option A. Me.Layout(MdiLayout.TileVertical)
Option B. Me.MdiLayout(MdiLayout.TileVertical)
Option C. Me.LayoutMdi(MdiLayout.TileVertical)
Option D. Nothing is required because default is Vertical

Question: 19. While handling keystrokes if e.Handled=True is set then Visual Basic
Option A. Will handle the key
Option B. Will not handle the key
Option C. Will send the key to Garbage collector
Option D. None of the above

Question: 20. Dim S as Integer=10
Text1=S
Msgbox(Text1.Text)
Option A. Will return error
Option B. Will return 10
Option C. Will return 0
Option D. Will return Null

Answer Sheet

1A
2B
3A
4B
5A
6A
7B
8A
9B
10C
11B
12A
13B
14B
15D
16C
17B
18C
19B
20A

PHP Programming new 68 Solved Mcq Question Answer

Question: 1.

What does PHP stand for?


i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page


Option A.

Both i) and iii)


Option B.

Both ii) and iv)


Option C.

Only ii)


Option D.

Both i) and ii)



Question: 2.

PHP files have a default file extension of..


Option A.

.html


Option B.

.xml


Option C.

.php


Option D.

.ph


Option E.

.asp


Option F.

.jsp



Question: 3.

A PHP script should start with ___ and end with ___:


Option A.

< php >


Option B.

< ? php ?>


Option C.

<?php ?>


Option D.

<% %>



Question: 4.

Which of the following is/are a PHP code editor?
i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT


Option A.

Only iv)


Option B.

All of the mentioned.


Option C.

i), ii) and iii)


Option D.

Only iii)



Question: 5.

Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS


Option A.

All of the mentioned.


Option B.

Only ii)


Option C.

ii) and iii)


Option D.

ii), iii) and iv)



Question: 6.

Which of following variables can be assigned a value to it?
i) $3hello
ii) $_hello
iii) $this
iv) $This


Option A.

All of the mentioned


Option B.

Only ii)


Option C.

ii), iii) and iv)


Option D.

ii) and iv)



Question: 7.

What will be the output of the following code?



<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>

Option A.

Error


Option B.

My name is BobBob


Option C.

My name is BobMy name is Bob


Option D.

My name is Bob Bob



Question: 8.

Which of the following PHP statements will output Hello World on the screen?
i) echo (“Hello World”);
ii) print (“Hello World”);
iii) printf (“Hello World”);
iv) sprintf (“Hello World”);


Option A.

i) and ii)


Option B.

i), ii) and iii)


Option C.

All of the mentioned


Option D.

i), ii) and iv)



Question: 9. What will be the output of the following PHP code ?
 <?php  $i = 0;
while ((--$i > ++$i) - 1){ print $i;
} ?>
Option A. 00000000000000000000….infinitely
Option B. -1-1-1-1-1-1-1-1-1-1…infinitely
Option C. no output
Option D. error

Question: 10. What will be the output of the following PHP code ?
 <?php  $color = red;
echo $color . red ;
?>
Option A. red red
Option B. red
Option C. error
Option D. nothing

Question: 11. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = red;
echo $color1 + $color2;
?>
Option A. redgreen
Option B. red green
Option C. 0
Option D. 1

Question: 12. What will be the output of the following PHP code ?
 <?php  define('GOOD_OCTAL', 0700);
define('BAD_OCTAL', 0600);
print GOOD_OCTAL;
print '
';
print BAD_OCTAL;
?>
Option A. 448
384
Option B. 0700
0800
Option C. ERROR
Option D. No output

Question: 13. What will be the output of the following PHP code?
 <?php  $a1 = array(red, green);
$a2 = array(blue, yellow);
print_r(array_merge($a1, $a2));
?>
Option A.
Array ( [0] => red [1] => green)
Option B.
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
Option C.
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
Option D.
Array ( [0] => blue [1] => yellow )

Question: 14. Which one of the following function is used to start a session?
Option A.
start_session()
Option B.
session_start()
Option C.
session_begin()
Option D.
begin_session()

Question: 15. What will be the output of the following PHP code?
 <?php  $a1 = array_fill(3, 4, blue);
$b1 = array_fill(0, 1, red);
print_r($a1);
echo
;
print_r($b1);
?>
Option A.
Array ( [3] => blue [4] => blue) 
Array ( [0] => red )
Option B.
Array ( [4] => blue [5] => blue [6] => blue) 
Array ( [0] => red )
Option C.
Array ( [3] => blue [4] => blue [5] => blue [6] => blue ) 
Array ()
Option D.
Array ( [3] => blue [4] => blue [5] => blue [6] => blue ) 
Array ( [0] => red )

Question: 16. What will be the output of the following PHP code ?
 <?php  $i = ;
while ($i = 10){ print hi;
}print hello;
?>
Option A. hello
Option B. infinite loop
Option C. hihello
Option D. error

Question: 17. What will be the output of the following PHP code?
 <?php  $a1 = array(a=>red, b=>green, c=>blue, d=>yellow);
$a2 = array(e=>red, f=>green, g=>blue);
$result = array_diff($a1, $a2);
print_r($result);
?>
Option A.
Array ( [d] => yellow )
Option B.
Array ( [c] => blue )
Option C.
Array ( [a] => red )
Option D.
Array ( [e] => yellow )

Question: 18. What will be the output of the following PHP code ?
 <?php  define(VAR_NAME,test);
${VAR_NAME} = value;
echo VAR_NAME;
echo ${VAR_NAME};
?>
Option A. test
Option B. testtest
Option C. testvalue
Option D. error, constant value cannot be changed

Question: 19. Which one of the following is the default PHP session name?
Option A. PHPSESSID
Option B. PHPSESID
Option C. PHPSESSIONID
Option D. PHPIDSESS

Question: 20. Which one of the following is the very first task executed by a session enabled page?
Option A. Delete the previous session
Option B. Start a new session
Option C. Check whether a valid session exists
Option D. Handle the session

Question: 21. What will be the output of the following PHP code ?
 <?php  $i = 5;
while (--$i > 0 && ++$i){ print $i;
} ?>
Option A. 5
Option B. 555555555…infinitely
Option C. 54321
Option D. error

Question: 22. What will be the output of the following PHP code ?
 <?php  $color = red;
$color = green;
echo $color;
?>
Option A. red
Option B. green
Option C. red green
Option D. error

Question: 23. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = green;
echo $color1 . $color2;
?>
Option A. red
Option B. green
Option C. red green
Option D. redgreen

Question: 24. What will be the output of the following PHP code?
 <?php  $a = array(a=>red, b=>green, c=>blue);
echo array_shift($a);
print_r ($a);
?>
Option A.
green
Option B.
red
Option C.
redArray( [c] => green [c] => blue )
Option D.
redArray( [b] => green [c] => blue )

Question: 25. How many ways can a session data be stored?
Option A. 3
Option B. 4
Option C. 5
Option D. 6

Question: 26. What will be the output of the following PHP code ?
 <?php  define('IF', 42);
echo IF: , IF;
?>
Option A. IF:42
Option B. No output
Option C. IF:
Option D. ERROR

Question: 27. Which one of the following format parameter can be used to identify timezone?
Option A. T
Option B. N
Option C. E
Option D. I

Question: 28. What will be the output of the following PHP code?
 <?php  $a = array(A, Cat, Dog, A, Dog);
print_r(array_count_values($a));
?>
Option A.
Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
Option B.
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
Option C.
Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
Option D.
Array ( [A] => 2 [Cat] => 1 [Dog] => 1)

Question: 29. Which one of the following function is useful for producing a timestamp based on a given date and time.
Option A.
time()
Option B.
mktime()
Option C.
mrtime()
Option D.
mtime()

Question: 30. What will be the output of the following PHP code?
 <?php  $a = array(red, green, blue);
array_pop($a);
print_r($a);
?>
Option A.
Array ( [0] => red [1] => green )
Option B.
Array ( [0] => green [1] => blue )
Option C.
Array ( [0] => red [1] => blue )
Option D.
Array ( [0] => blue [1] => blue )

Question: 31. What will be the output of the following PHP code ?
 <?php  /*echo Hello world;
*/ ?>
Option A. Hello world
Option B. Nothing
Option C. Error
Option D.
/* Hello world */

Question: 32. What will be the output of the following PHP code? If say date is 22/06/2013.
     <?php      printf( date(t) )     ?> 
Option A. 30
Option B. 22
Option C. JUNE
Option D. 2013

Question: 33. What will be the output of the following PHP code?
 <?php   $fname = array(Peter, Ben, Joe);
$age = array(35, 37, 43);
$c = array_combine($fname, $age);
print_r($c);
?>
Option A.
Array ( Peter Ben Joe )
Option B.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Option C.
Array ( 35 37 43 )
Option D.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )

Question: 34. Say you want to calculate the date 45 days from the present date which one of the following statement will you use?
Option A.
totime(+45)
Option B.
totime(+45 days)
Option C.
strtotime(+45 days)
Option D.
strtotime(-45 days)

Question: 35. What will be the output of the following PHP code?
     <?php      echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');
?>
Option A. TRUE
Option B. FALSE
Option C. Valid
Option D. Invalid

Question: 36. What will be the output of the following PHP code ?
 <?php  define(__LINE__, PHP is a scripting language);
echo __LINE__;
?>
Option A. PHP is a scripting language
Option B. __LINE__
Option C. 2
Option D. ERROR

Question: 37. What will be the output of the following PHP code ?
 <?php  class Constants{    define('MIN_VALUE', '0.0');
define('MAX_VALUE', '1.0');
public static function getMinValue() { return self::MIN_VALUE;
} public static function getMaxValue() { return self::MAX_VALUE;
}}echo Constants::getMinValue();
echo Constants::getMaxValue();
?>
Option A. 0.01.0
Option B. 01
Option C. No output
Option D. ERROR

Question: 38. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = green;
echo $color1 + $color2;
?>
Option A. redgreen
Option B. red green
Option C. 0
Option D. error

Question: 39. What will be the output of the following PHP code?
 <?php  $age = array(Peter=>35, Ben=>37, Joe=>43);
print_r(array_change_key_case($age, CASE_UPPER));
?>
Option A.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Option B.
Array ( [peter] => 35 [ben] => 37 [joe] => 43 )
Option C.
Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )
Option D.
Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )

Question: 40. What will be the output of the following PHP code ?
 <?php  $i = 0;
while ($i = 10){ print hi;
}print hello;
?>
Option A. hello
Option B. infinite loop
Option C. hihello
Option D. error

Question: 41. What will be the output of the following PHP code ?
 <?php  define(GREETING, PHP is a scripting language);
echo $GREETING;
?>
Option A. $GREETING
Option B. no output
Option C. PHP is a scripting language
Option D. GREETING

Question: 42. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = green;
echo $color1.$color2;
?>
Option A. red green
Option B. red
Option C. green
Option D. error

Question: 43. What will be the output of the following PHP code ?
 <?php  $i = 2;
while (++$i){ while (--$i > 0) print $i;
} ?>
Option A. 210
Option B. 10
Option C. no output
Option D. infinite loop

Question: 44. Which function displays the web pages most recent modification date?
Option A.
lastmod()
Option B.
getlastmod()
Option C.
last_mod()
Option D.
get_last_mod()

Question: 45. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = 1;
echo $color1 + $color2;
?>
Option A. red1
Option B. red 1
Option C. 0
Option D. 1

Question: 46. What will be the output of the following PHP code ?
 <?php  $i = 5;
while (--$i > 0 || ++$i){ print $i;
} ?>
Option A. 54321111111….infinitely
Option B. 555555555…infinitely
Option C. 54321
Option D. 5

Question: 47. What is the default number of seconds that cached session pages are made available before the new pages are created?
Option A. 360
Option B. 180
Option C. 3600
Option D. 1800

Question: 48. What will be the output of the following PHP code ?
 <?php  define('GREETING_TEST', 'PHP is a scripting language', true);
echo GREETING_TESt;
$changing_variable = 'test';
echo constant('GREETING_' . strtoupper($changing_variable));
?>
Option A. PHP is a scripting language
PHP is a scripting language
Option B. GREETING_TESt
Option C. PHP is a scripting language
Option D. PHP is a scripting language
GREETING_TEST

Question: 49. If the directive session.cookie_lifetime is set to 3600, the cookie will live until..
Option A. 3600 sec
Option B. 3600 min
Option C. 3600 hrs
Option D. the browser is restarted

Question: 50. What will be the output of the following PHP code ?
 <?php  define(NEW_GOOD_NAME_CONSTANT, I have a value);
define(OLD_BAD_NAME_CONSTANT, NEW_GOOD_NAME_CONSTANT);
�echo NEW_GOOD_NAME_CONSTANT;
echo OLD_BAD_NAME_CONSTANT;
?>
Option A. I have a value
Option B. I have a valueI have a value
Option C. ERROR
Option D. I have a valueNEW_GOO_NAME_CONSTANTS

Question: 51. What will be the output of the following PHP code ?
 <?php  $i = 0;
while (++$i && --$i){ print $i;
} ?>
Option A. 1234567891011121314….infinitely
Option B. 01234567891011121314…infinitely
Option C. no output
Option D. error

Question: 52. What will be the output of the following PHP code?
 <?php  $cars = array(Volvo, BMW, Toyota);
echo I like . $cars[0] . , . $cars[1] . and . $cars[2] . .;
?>
Option A. I like Volvo BMW and Toyota.
Option B. I like Volvo, BMW and Toyota)
Option C. I like Volvo, BMW and Toyota.
Option D. I like. Volvo.,. BMW. and. Toyota)

Question: 53. What will be the output of the following PHP code ?
 <?php  define(GREETING, PHP is a scripting language, true);
echo GREETING;
echo
echo GREETING;
?>
Option A. PHP is a scripting language
Option B. GREETING
GREEtING
Option C. GREETING
Option D. PHP is a scripting language
PHP is a scripting language

Question: 54. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?
Option A.
$date = Date(22 JUNE 2013)
Option B.
$date = new Date(JUNE 22 2013)
Option C.
$date = DateTime(22 JUNE 2013)
Option D.
$date = new DateTime(22 JUNE 2013)

Question: 55. If the format is F then which one of the following will be returned?
Option A. Complete text representation of month
Option B. Day of month, with leading zero
Option C. Daylight saving time
Option D. Day of month, without zeros

Question: 56. Neglecting to set which of the following cookie will result in the cookies domain being set to the host name of the server which generated it.
Option A.
session.domain
Option B.
session.path
Option C.
session.cookie_path
Option D.
session.cookie_domain

Question: 57. What will be the output of the following PHP code ?
 <?php  $i = 0;
while(++$i || --$i){ print $i;
} ?>
Option A. 1234567891011121314….infinitely
Option B. 01234567891011121314…infinitely
Option C. 1
Option D. 0

Question: 58. What will be the output of the following PHP code ?
 <?php  class myObject { }define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;
?>
Option A. test
Option B. error
Option C. myObject::CONSTANT
Option D. no output

Question: 59. What is the default time(in seconds) for which session data is considered valid?
Option A. 1800
Option B. 3600
Option C. 1440
Option D. 1540

Question: 60. If session.use_cookie is set to 0, this results in use of..
Option A. Session
Option B. Cookie
Option C. URL rewriting
Option D. Nothing happens

Question: 61. Which directive determines how the session information will be stored?
Option A.
save_data
Option B.
session.save
Option C.
session.save_data
Option D.
session.save_handler

Question: 62. What will be the output of the following PHP code ?
 <?php  $i = 5;
while (--$i > 0){ $i++;
print $i;
print hello;
} ?>
Option A. 4hello4hello4hello4hello4hello…..infinite
Option B. 5hello5hello5hello5hello5hello…..infinite
Option C. no output
Option D. error

Question: 63. What will be the output of the following PHP code ?
 <?php  $color1 = 1;
$color2 = 1;
echo $color1 + $color2;
?>
Option A. 11
Option B. 2
Option C. 0
Option D. 1

Question: 64. What will be the output of the following code? If say date is 22/06/2013.
     <?php      echo Today is .date(F d, Y)     ?> 
Option A. Today is 22 June, 2013
Option B. Today is 22-06-2013
Option C. Today is 06-22-2013
Option D. Today is June 22, 2013

Question: 65. What will be the output of the following PHP code?
 <?php  $cars = array(Volvo, BMW, Toyota, Honda, Mercedes, Opel);
print_r(array_chunk($cars, 2));
?>
Option A.
Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
Option B.
Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )
Option C.
Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
Option D.
Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )

Question: 66. What will be the output of the following PHP code ?
 <?php  $i = 2;
while (++$i){ while ($i --> 0) print $i;
} ?>
Option A. 210
Option B. 10
Option C. no output
Option D. infinite loop

Question: 67. The date() function returns ___ representation of the current date and/or time.
Option A. Integer
Option B. String
Option C. Boolean
Option D. Float

Question: 68. What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = 1;
$color3 = greyecho $color1 + $color2 . $color3;
?>
Option A. 1grey
Option B. grey
Option C. 0
Option D. red1grey

Answer Sheet

1D

PHP previously stood for Personal Home Page now stands for Hypertext Preprocessor.


2C
3C

Every section of PHP code starts and ends by turning on and off PHP tags to let the server know that it needs to execute the PHP in between them.


4B

Any of the above editors can be used to type php code and run it.


5D

To run PHP code you need to have PHP and a web server, both IIS and Apache are web servers.You can choose either one according to your platform.


6D

A variable can’t start with a number. Also $this is a special variable that can’t be assigned, but $This can be assigned


7C

The $bar = &$foo; line will reference $foo via $bar.


8B

echo(), print() and printf() all three can be used to output a statement onto the screen. The sprintf() statement is functionally identical to printf() except that the output is assigned to a string rather than rendered to the browser.


9A($i > ++$i) evaluates to 0 but -1 makes it enters the loop and prints i which is 0.
10CUse of undefined constant red.
11C+ does not return 1 if the variables are equal.
12AAnything starting from 0 is evaluated as an octal.
13CThe array_merge() function merges one or more arrays into one array.
14B
15DThe array_fill() function fills an array with values.
16BWhile condition always gives 1.
17AThe array_diff() function compares the values of two (or more) arrays, and returns the differences.
18C
${VAR_NAME}
creates a new variable which is not same as VAR_NAME.
19AYou can change this name by using the session.name directive.
20C
21BAs it is && operator it is being incremented and decremented continuously.
22BThe variable contains the last value which has been assigned.
23DThe . operator is used to join to strings.
24DThe array_shift() function removes the first element from an array, and returns the value of the removed element.
25BWithin flat files(files), within volatile memory(mm), using the SQLite database(sqlite), or through user defined functions(user).
26DKeyword like IF cannot be used as constant names.
27CWhen the format is E the timezone is identified and returned…example America/New_York.
28AThe array_count_values() function counts all the values of an array.
29B
30AThe array_pop() function deletes the last element of an array.
31B/* */ is used for commenting multiple lines.
32AThe t parameter is used to determine the number of days in the current month.
33BThe array_combine() function creates an array by using the elements from one keys array and one values array.
34CThe
strtotime()
function and GNU date syntax is used to calculating the date x days from the present date.
35DApril has 30 days and the above date is 31 therefore Invalid is returned.
36C__LINE__ is a magical constant that gives the current line number and cannot be used a variable/constant name.
37DIn a class constants should be defined const MIN_VALUE = 0.0;
const MAX_VALUE = 1.0;
instead.
38C+ operator does not join both the strings.
39CThe array_change_key_case() function changes all keys in an array to lowercase or uppercase.
40BWhile condition always gives 1.
41BConstants do not need a $ before them, they are referenced by their variable names itself.
42DIt has to be $color1 = red;
and $color2 = green;
therefore the error.
43DThe loop never ends as i is always incremented and then decremented.
44BThe getlastmod() function returns the value of the pages Last Modified header or FALSE in the case of an error.
45D+ just returns the numeric value even though it is inside double quotes.
46AAs it is || operator the second expression is not evaluated till i becomes 1 then it goes into a loop.
47BThe directive which determines this is session.cache_expire.
48Aecho constant(x) output x, and x here is the concatenation of GREETING_ and $changing variable with. operator.
49AThe lifetime is specified in seconds, so if the cookie should live 1 hour, this directive should be set to 3600.
50BConstants can be set as values for other constants.
51CThe first condition itself fails thus the loop exits.
52BThe array() function is used to create an array. Each elements are assigned ab index as the rule of an array. So, calling $cars[0] will print element at index 0 and so on.
53DSince the third parameter is true in define(GREETING, PHP is a scripting language, true) is true GREETING becomes case insensitive.
54DThe
dateTime()
method is class constructor. You can set the date either at the time of instantiation or later by using a variety of mutators.
55ADay of month, with leading zero is represented by D;
Daylight saving time by I;
Day of month, without zeros by j.
56DThe directive
session.cookie_domain
determines the domain for which the cookie is valid.
57AAs it is || operator the second expression is not evaluated and i is always incremented, in the first case to 1.
58BClass constants cannot be defined outside class.
59CThe
session.gc_maxlifetime
directive determines this duration. It can be set to any required value.
60C
61DIts prototype follows: session.save_handler = files|mm|sqlite|user.
62Ai is decremented in the first while execution and then continuously incremented back.
63B+ can be used to add to integer values which are enclosed by double-quotes.
64DF is the parameter for complete text representation of month, d for day of month, and Y for 4 digit representation of year.
65DThe array_chunk() function splits an array into chunks of new arrays.
66AThe loop ends when i becomes 0.
67BThe prototype of this function is: string date(string format [, int timestamp]).
68A+ gives the value 1 and . is used to give join 1 and grey.