programming languages Online Quiz - 149
Description: programming languages Online Quiz - 149 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
The printf format "%6.2f" displays a number
In Perl, which of the following are file handles?
$val = 'a\b\n';print $val;What gets printed?
my $txt = 'I am learning Perl'; $txt =~ /(\w+)$/; What is value of $txt?
Which of the following is NOT a comment line in a Perl program?
Which of the following is used in perl?
Which of the above is valid variable name?
which one of the below is correct with respect to string repeatation a) print "TEST" X 10; b) print "TEST" x 10; c) print 10 X "TEST"; d) print 10 x "TEST";
What will be the value of $keys? my %hash; $hash{undef} = undef; $hash{''} = ''; my $keys = keys(%hash);
which is among the following is not a loop a) For b) foreach c)map d) until e) switch
“name” is an array.Which of the following are correct way to find size of a ruby array? Select all that apply.
The correct way to find index of an array element.days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] is days.index(“Saturday”).
i = 0 10.times do i += 1 puts i End The output will be => 1 2 3 4 5 6 7 8 9 10
0.upto(10) { |i| puts I} Output will be=> 1 2 3 4 5 6 7 8 9 10
0.upto(10) { |i| puts i} Output will be=> 0 1 2 3 4 5 6 7 8 9 10
my_array = ["alpha", "beta", "gamma"] puts my_array.collect do |word| word.capitalize End==> output? alpha beta gamma
my_array = ["alpha", "beta", "gamma"] puts my_array.collect { |word| word.capitalize } Output => Alpha Beta Gamma
for ss in 1...10 print ss, " Hello\n";end => Find output? 1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 Hello 7 Hello 8 Hello 9 Hello
ss = 5 while ss > 0 puts ss ss -= 2 if ss == 1 ss += 5 end end Output=> 5 3 6 4 2
ss = 5 while ss > 0 puts ss ss -= 2 if ss == 1 ss += 5 end end The output will be 5 3 6 4 2 7