Question
Need help with Perl, using perl 5 Exercise A3 What is the value of $x and $y after the following statements? $x = 4; $x++;
Need help with Perl, using perl 5
Exercise A3
What is the value of $x and $y after the following statements? $x = 4; $x++; $y += $x + 3;
Exercise A4
Which of the following expressions evaluate to true, and which evaluate to false?
4 < "23A"
-14 < "-13"
"14" != 14
0 >= "AB"
Exercise A5
What is the value of each of the following expressions?
1 <=> 7
2 <=> "H"
4 cmp 7
"4" <=> undef
Exercise A6
Which of the following expressions evaluate to true, and which evaluate to false?
"Hi" && 2
"Hi" || 2
"00" && 4
"00" || "0"
Exercise A7
The following statements set the values:
$x = 3;
$y = 0;
$z = -4;
Then, which of the following expressions evaluate to true, and which evaluate to false?
!( $x < $y ) = True
!( $x >= $y ) False
!( (4 + 5 * $y) >= $z -2 ) && ( $z - 2 )
!($x) && !($y) || !($z)
Exercise A8
Code a single statement, which uses the && operator, and produces the same results as this code:
if ( $x < 10 )
{
$x++;
}
Exercise A9
Code a single statement, which uses the || operator, and produces the same results as this code:
unless ( $x < 10 )
{
$x++;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started