Answer to Question #53585 in Perl for zexy

Question #53585
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
1
Expert's answer
2015-07-22T08:23:43-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS