0

programming languages Online Quiz - 123

Description: programming languages Online Quiz - 123
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

my $txt = ‘I am learning Perl’; $txt =~ /(\w+)$/; print $1;

  1. I am learning Perl

  2. I

  3. Perl

  4. l

  5. learning


Correct Option: C

In perl, a/n -------------- is a special character or a sequence that will define the number of times the previous character or sequence appears.

  1. Character Class

  2. Meta character

  3. Quantifier

  4. Assertion


Correct Option: C

$input = “abdce”; $output = $input =~ s/abc/123; print $input; print $output

  1. abcde nullstring

  2. abdce 3

  3. abdce null string

  4. abdce 0

  5. abdce 1


Correct Option: C

splice(@array,-1)

  1. Equal to Pop

  2. Equal to Push

  3. Equal to Shift

  4. Equal to Unshift

  5. Does nothing


Correct Option: A

push (@array, @sublist);

  1. splice (@array, 0, 1);

  2. splice (@array, @array-1, 1);

  3. splice (@array, scalar(@array), 0, @sublist);

  4. splice (@array, 0, 0, @sublist);


Correct Option: C

unshift (@array, @sublist);

  1. splice (@array, 0, 1);

  2. splice (@array, @array-1, 1);

  3. splice (@array, scalar(@array), 0, @sublist);

  4. splice (@array, 0, 0, @sublist);


Correct Option: D

$input = 'abc'; print --$input;

  1. abc

  2. abb

  3. minus 1

  4. Error:Can perform this operation


Correct Option: C

@array = (1,2,3,4,5) $scalar1, $scalar2 = @array; print “Scalar1 value is $scalar1”; print “Scalar2 value is $scalar2”;

  1. 1 2

  2. 4 5

  3. 5 5

  4. Null value 5


Correct Option: D

@array= (“one”,”two”,”three”,”four”,”five”); @sublength = (1,2,3); @sub_array = @array[@sublength]; print @sub_array;

  1. one two three

  2. two three four

  3. 3

  4. Error:unknown array


Correct Option: B

$input = “bc999”; print ++$input;

  1. bc999

  2. bd000

  3. bc100

  4. cd100


Correct Option: B
  1. Compiled Language

  2. Interpretive Language

  3. Machine Language

  4. All the above


Correct Option: B

. Shifting left n bits, and right n bits, Where n is some number greater than 0 is equivalent to?

  1. Mulitplying by 2*n and Dividing by 2*n

  2. Dividing by 2*n and Multiplying by 2*n

  3. Multiplying by n and Dividing by n

  4. Dividing by n and Multiplying by n


Correct Option: A

/de{3,}/ matches

  1. deeef

  2. def

  3. deef

  4. deeeef

  5. AandD


Correct Option: E

@array = (1,2); ($scalar1, $scalar2, $scalar3)=@array; print $scalar1, $scalar2, $scalar3;

  1. 1 2 Null value

  2. 1 2 0

  3. 1 2 3

  4. Error:Array out of bound


Correct Option: A

Is null string list (“”) equivalent to empty list()

  1. True

  2. False


Correct Option: B

/abc(?=def)/ matches?

  1. abc

  2. abcdef

  3. abcdefgh

  4. abcde

  5. II and III


Correct Option: E
  1. abc

  2. abcdef

  3. abcd

  4. abdef

  5. I and III


Correct Option: E
- Hide questions