interview question

    技术2022-05-18  13

    Basic

     

    1. Which statement is wrong:

     

    A.        $_= 'hello world';

     

    B.        $a='hello world';

     

    C.        my $b,$a='hello world';

     

    D.       my ($a,$b)=(0,'hello world');

     

    Item C: $b is empty and $a is ‘hello world’

    All of items is correct in program syntax, and can run.

     

     

    2. The expression should be (B), then the following code can run correctly:

     

    $a=0;$b=55;

     

    while (expression)

     

    {

     

      $a+=2;

     

    }

     

    print "$a/n";

     

    A.        $a = $b

     

    B.        $a*$a <= $b

     

    C.        $a != $b

     

    D.       $b == 0

     

     

     

    3. @array is an array variable, what is output of “print @array;” :A

     

    A.        Each element of this array

     

    B.        The size of this array

     

    C.        The first element of this array

     

    D.       Nothing

     

     

     

    4. “$a = @array;”, what is value of $a: B

     

    A.        The first element’s value of this array

     

    B.        The size of this array

     

    C.        This line code is wrong

     

    D.       N/A

     

     

     

    5. Which code snippet can print all elements in

    转载请注明原文地址: https://ibbs.8miu.com/read-2169281.html

    最新回复(0)