Tuesday, August 6, 2013

PHP MCQ Test – 3


Que.1. Which of following are compound data type?

A:        Array
B:        Objects
C:        Both
D:        None

Right Answer: C

Que.2. <?php
$x=array(2=>"apple",7=>"orange");
$y=array_keys($x);
echo $y[1];
?>

A:        apple
B:        orange
C:        7
D:        2


Right Answer: C

Que.3. How would you add 1 to the variable $count in PHP?

A:        incr count;
B:        $count++;
C:        $count =+1
D:        incr $count;

Right Answer: B

Que.4. Which of the following delimiting method is known as string Interpolation in PHP.

A:        delimited by single quote
B:        delimited by double quote
C:        delimited by <<< identifier
D:        All of above

Right Answer: C

Que.5. Trace the odd data type

A:        floats
B:        integer
C:        doubles
D:        Real number

Right Answer: B

Que.6. PHP variables are ___________.

A:        Multitype variables
B:        Double type variables
C:        Single type variable
D:        Trible type variables

Right Answer: A

Que.7. <?php
$qpt = 'Eat to live, but not live to eat';
echo preg_match("/^to/", $qpt);
?>
What is the output of following script?

A:        0
B:        1
C:        Null

Right Answer: A

Que.8. In PHP the error control operator is _______.

A:        #
B:        .
C:        @
D:        &

Right Answer: C

Que.9. <?php
$str="101.5degrees";
(double)$str;
(int)$str;
echo (string)$str;
?>

A:        101.5
B:        degrees
C:        101
D:        101.5degrees

Right Answer: D

Que.10. Which of the following is used to check if a function has already been defined?

A:        bool function_exists(functionname)
B:        bool f_exists(functionname)
C:        bool func_exist(functioname)

Right Answer: A

Que.11. In PHP, during error handling include() generates _______________.

A:        a fatal error, and the script will stop
B:        a warning, but the script will continue execution
C:        None of the above

Right Answer: B

Que.12. Which of the following function is used for terminate the script execution in PHP?

A:        break()
B:        quit()
C:        die()

Right Answer: C

Que.13. Which datatypes are treated as arrays?

A:        Integer
B:        Float
C:        String
D:        Booleans

Right Answer: C

Que.14. What happens if you add a string to an integer using the + operator?

A:        The interpreter outputs a type mismatch error
B:        The string is converted to a number and added to the integer
C:        The string is discarded and the integer is preserved
D:        The integer and string are concatenated together in a new string
E:         The integer is discarded and the string is preserved

Right Answer: B

Que.15. What function used to print statement in PHP?

A:        echo();
B:        printf
C:        ""

Right Answer: A

Que.16. What will the following script output?
<?php
$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);
$result = 0;
for ($i = 0; $i < 5; $i++) {
$result += $array[$array[$i]];
}
echo $result;
?>

A:        78
B:        19
C:        NULL
D:        5

Right Answer: A

Que.17. Is it possible to submit a form with out a submit button ?

A:        Yes
B:        No

Right Answer: A

Que.18. Which of the following function is used to pick one or more random values from PHP Array?

A:        array_rand()
B:        array_random()
C:        Random_array()
D:        Rand_array()

Right Answer: A

Que.19. What's the best way to copy a file from within a piece of PHP?

A:        Print out a message asking your user to "telnet" in to the server and copy the file for you
B:        Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
C:        Use the built in copy() function
D:        Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)

Right Answer: C

Que.20. For integer data type PHP 6 introduced

A:        8 bit integer value
B:        16 bit integer value
C:        32 bit integer value
D:        64 bit integer value

Right Answer: D

.NET MCQ Test – 3


 Que.1. Choose the correct one

A:        The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
B:        Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.
C:        Lamda expression does not work with LINQ
D:        None of the above

Right Answer: B

Que.2. Choose the correct one

A:        Variables introduced within a lambda expression are not visible in the outer method.
B:        Variables introduced within a lambda expression are visible in the outer method.
C:        The lambda should not contain the same number of parameters as the delegate type.
D:        None of the above

Right Answer: A

Que.3. For building new types at runtime which class can be used

A:        System
B:        System.Object
C:        System.NewClass
D:        System.Reflection.Emit.

Right Answer: D

Que.4. A web application can contain

A:        Only One Web.Config File
B:        Only Two Web.Config File
C:        Can be more than ONE
D:        None of the above

Right Answer: C

Que.5. You have to log the data into database if your session times out.Which event you will use?

A:        Session_End
B:        Application_End
C:        Application_Start
D:        Application_SessionTimeout

Right Answer: A

Que.6. Choose the correct one

A:        Dynamic type is non static type
B:        Dynamic type is static type
C:        Implicit conversion does not work with type dynamic
D:        None

Right Answer: B

Que.7. Which SqlCommand execution return the number of effected records in the table?

A:        ExecuteNonQuery
B:        ExecuteReader
C:        ExecuteXmlReader
D:        ExecuteScalar

Right Answer: A

Que.8. If you are using Webparts in your web page then which control is necessary?

A:        WebpartController
B:        WebPartmanager
C:        WebpartZone
D:        None

Right Answer: B

Que.9. Choose the correct one

A:        The lambda must contain the same number of parameters as the delegate type.
B:        The lambda should not contain the same number of parameters as the delegate type.
C:        The return value of the lambda (if any) must be explicitly convertible to the delegate's return type
D:        None of the above

Right Answer: A

Que.10. What is lamda expression?
1.Anonymous function
2.Can be used to create delegates
3.Named function
4.None

A:        1, 2
B:        1,2,3
C:        1,3
D:        4

Right Answer: A

Que.11. How you can merge the results from two separate LINQ queries into a single result set.

A:        Use the ToList method.
B:        Use the DataContractJsonSerializer class.
C:        Use the XElement class.
D:        Use the Concat method.

Right Answer: D

Que.12. Which of the following is true when referencing master page from content page?

A:        Content pages can reference private indexer in the master page.
B:        Content pages can reference private Properties in the master page.
C:        Content pages can reference public Properties in the master page.
D:        Content pages can reference private Methods in the master page.

Right Answer: C

Que.13. Which of the following objects represents a LINQ to SQL O/R map?

A:        DataSet
B:        XElement
C:        ObjectContext
D:        DataContext

Right Answer: D

Que.14. Which data provider gives the maximum performance from a connection to SQL Server?

A:        The OLE DB data provider.
B:        The JDBC data provider.
C:        The SqlClient data provider.
D:        The Oracle data provider

Right Answer: C

Que.15. What component do you need to enable for a user to add new web parts ?

A:        WebpartZone
B:        CatalogZone
C:        WebPartManager
D:        WebManager

Right Answer: B

Que.16. Which CommandType value is incorrect?

A:        StoredProcedure
B:        TableDirect
C:        TableSchema
D:        Text

Right Answer: B

Que.17. Which SqlCommand execution return the value of the first column of the first row from a table?

A:        ExecuteNonQuery
B:        ExecuteReader
C:        ExecuteXmlReader
D:        ExecuteScalar

Right Answer: D

Que.18. LINQ query can work with?

A:        DataSet
B:        List< T>
C:        Array
D:        All of the above

Right Answer: D

Que.19. What is jQuery?
1.jQuery is an open source library
2.It works client side.
3.jQuery is java technology.
4.None

A:        1, 2
B:        1,2,3
C:        1,3
D:        4

Right Answer: A

Que.20. The best way for handling exception when dealing with a database connection?

A:        Implement a try/catch block that catches System.Exceptions.
B:        Implementing custom error page.
C:        Implement a try/catch block that catches individual exception types, such as SQLException.
D:        Display an error message.

Right Answer: A