0

programming languages Online Quiz - 218

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

Which file test can be done to see if a file exists and has a nonzero size?

  1. -s

  2. -l

  3. -S

  4. -k


Correct Option: A
  1. The code will output the following:123

  2. The code will output the following: 3

  3. The code will output the following:23

  4. The code will output the following: 321


Correct Option: A

Which line of code represents the correct syntax to establish a reference to a database handle?

  1. $dbh = DBI::connect("dbi:mysql:myPhoneBook");

  2. $dbh = DBD:->connect("dbi::mysql::myPhoneBook");

  3. $dbh = DBD::connect("mysql:dbi:myPhoneBook");

  4. $dbh = DBI->connect("dbi:mysql:myPhoneBook");


Correct Option: D
  1. Page length of a particular output file

  2. The input end-of-line character

  3. The return code returned by a command called by the system function.

  4. The error code generated by a system library routine


Correct Option: C

What do the variable $! contains?

  1. Page length of a particular output file

  2. The input end-of-line character

  3. The return code returned by a command called by the system function.

  4. The error code generated by a system library routine.


Correct Option: D

What argument to splice is equivalent to push (@array, @sublist) function call?

  1. splice (@array,[email protected]);

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

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

  4. None of Above


Correct Option: B

Which statement will print the capital attribute of the $kansas object?

  1. print ("capital"=>$kansas);

  2. print {$kansas}=>(capital);

  3. print (capital)<={$kansas};

  4. print $kansas->{"capital"};


Correct Option: D

Consider the following program code @array= (“Y”,”W”,”X”); @array=sort(@array); unshift(@array , ”Z”); print($array[0]); What is the output of this code

  1. W

  2. X

  3. Y

  4. Z


Correct Option: D
- Hide questions