New ! Computer Applications MCQ Practise Tests



PHP Function and Array 1 Mark Creative Question Paper With Answer Key

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Applications

Time : 00:20:00 Hrs
Total Marks : 15

    Multiple Choice Question

    15 x 1 = 15
  1. Which of the following are correct ways of creating an array?
    i) state[0] = “Tamilnadu”;
    ii) \($\)state[] = array(“Tamilnadu”);
    iii) \($\)state[0] = “Tamilnadu”;
    iv) \($\)state = array(“Tamilnadu”);

    (a)

    iii) and iv)

    (b)

    ii) and iii)

    (c)

    Only i)

    (d)

    ii), iii) and iv)

  2. What will be the output of the following PHP code?
    < ?php
    \($\)a=array(“A”,”Cat”,”Dog”,”A”,”Dog”);
    \($\)b=array(“A”,”A”,”Cat”,”A”,”Tiger”);
    \($\)c=array_combine(\($\)a,\($\)b);
    print_r(array_count_values(\($\)c));
    ? >

    (a)

    Array ( [A] = > 5 [Cat] = > 2 [Dog] = > 2 [Tiger] = > 1 )

    (b)

    Array ( [A] = > 2 [Cat] = > 2 [Dog] = > 1 [Tiger] = > 1 )

    (c)

    Array ( [A] = > 6 [Cat] = > 1 [Dog] = > 2 [Tiger] = > 1 )

    (d)

    None of these

  3. For finding non empty elements in array we use

    (a)

    is_array ( ) function

    (b)

    size of ( ) function

    (c)

    array_count ( ) function

    (d)

    array_count ( ) function

  4. Indices of arrays can be either strings or numbers and they are denoted as

    (a)

    $my_array {4}

    (b)

    $my_array [4]

    (c)

    $my_array | 4 |

    (d)

    None of them

  5. PHP arrays are also called as

    (a)

    Vector arrays

    (b)

    Perl arrays

    (c)

    Hashes

    (d)

    All of them

  6. As compared to associative arrays vector arrays are much

    (a)

    Faster

    (b)

    Slower

    (c)

    Stable

    (d)

    None of them

  7. What functions count elements in an array?

    (a)

    count

    (b)

    Size of

    (c)

    Array_Count

    (d)

    Count_array

     

  8. A block of segment in a program that performs a specific operation tasks is known as

    (a)

    Arrays

    (b)

    Segments

    (c)

    Functions

    (d)

    All of these

  9. A Function is a type of___________.

    (a)

    sub routine

    (b)

    procedure

    (c)

    Either a or b

    (d)

    None of these

  10. __________ arrays are a key-value pair data structure.

    (a)

    Associative

    (b)

    Indexed

    (c)

    Multi-dimensional

    (d)

    All of these

  11. A _________ array is an array containing one or more arrays.

    (a)

    Associative

    (b)

    Indexed

    (c)

    Multi-dimensional

    (d)

    All of these

  12. Which of the following is the server side scripting language?

    (a)

    Java script

    (b)

    Java

    (c)

    PHP

    (d)

    Function and Array

  13. How many types of functions are there in PHP?

    (a)

    Two

    (b)

    Three

    (c)

    Four

    (d)

    Only one

  14. Which of the following is not related to the function types?

    (a)

    User defined

    (b)

    Built-in

    (c)

    Built-up

    (d)

    Parameterized

  15. A function will be executed by a call to the function and the function returns any data type values or _______ value to called function is the part of respective programs.

    (a)

    ONE

    (b)

    TWO

    (c)

    N

    (d)

    NULL

*****************************************

Reviews & Comments about 12th Standard Computer Applications English Medium - PHP Function and Array 1 Mark Creative Question Paper and Answer Key 2022 - 2023

Write your Comment