0
Alien head

programming languages Online Quiz - 98

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

Which function removes last character of a string?

  1. chop

  2. chomp

  3. delete

  4. chopp


Correct Option: A

Which of the following block executes at compile time?

  1. END

  2. BEGIN

  3. CHECK

  4. INIT


Correct Option: B

What is the name of default namespace in perl?

  1. main

  2. Main

  3. global

  4. name


Correct Option: A

Which subroutine you need to define in your package if you want to handle calls to non-existing subroutines?

  1. DESTROY

  2. AUTOHANDLE

  3. AUTOLOAD

  4. AUTOLOADER


Correct Option: C

How to compile a perl program?

  1. perl -c <>

  2. perl -c

  3. You cannot compile a program

  4. perl -e <>


Correct Option: A

How to length of string ?

  1. Length

  2. length

  3. len

  4. strlen


Correct Option: A

Which special variable actually tells perl where to look for perl modules ?

  1. %INC

  2. @INC

  3. INC

  4. %PATH%


Correct Option: B

Which function you will use to create object in perl?

  1. bless

  2. createobject

  3. create_object

  4. blessed


Correct Option: A

chomp(@array) will

  1. work on first eleemnt of array

  2. work on last element of array

  3. works on all elements of array

  4. wont work on array


Correct Option: C

How to check if key exists in a hash or not ?

  1. exists

  2. defined

  3. undef

  4. exist


Correct Option: A

what is output of print abs("123abc") ?

  1. 0

  2. 123

  3. abc

  4. 12


Correct Option: B

How to remove first element of a array?

  1. unshift

  2. delete

  3. shift

  4. move


Correct Option: C

How to check version of perl on your machine ?

  1. perl -b

  2. perl -version

  3. perl -c

  4. perl -k


Correct Option: B

In perl ,if $variable="10" then what will output of print 'this is $variable'; ?

  1. this is $10

  2. this is $variable

  3. this is

  4. this is 10


Correct Option: B

To repeat the iteration of loop we will use following statement ?

  1. next

  2. repeat

  3. recall

  4. redo


Correct Option: D

Which variable stores the parameters passed to subroutine?


Correct Option: C

Which Operator can be used in sort function for sorting array elements numerically?

  1. <>

  2. >

  3. <=>

  4. cmp


Correct Option: C

$string = "good food"; $string =~ s/o*/e/;print $string;

  1. geod food

  2. geed food

  3. geed feed

  4. egood food


Correct Option: D

output of below Program public static voi main(String[] args) { ArrayList; al=new List();//1 al.add("bima");//2 al.add("hidimba");//3 System.out.println(al.size());//4 }

  1. Runtime Exception

  2. Compilation error at line 1

  3. 2

  4. Compilation error at line 2

  5. Compilation error at line 3

  6. Compilation error at line 4


Correct Option: B

main() { float me = 1.1; double you = 1.1; if(me==you) printf("I Don't Know C"); else printf("I Know C"); }

  1. I Know C

  2. I Don't Know C

  3. Compilation error

  4. None


Correct Option: A
+ View questions