Question: What will be printed? Why?
$a="no"; # assign variable
if ($a) { #Loop test for variable $results = "Yes!"; #Success?} else { #or maybe $results = "no"; #Failure}
print $results; #Let's find out
Answer:
Program in such a way as it is written will not work, because he has syntax errors .
Character # refers to the entire line a comment.
After correction program has look:
$a="no"; # assign variable
if ($a) {
#Loop test for variable
$results = "Yes!";
#Success?
}
else {
#or maybe
$results = "no";
#Failure
}
print $results; #Let's find out
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
Perl