Question: 5. (a) (4%) C/C++/Java and Perl share similar syntax for an if-then-else statement. However, C/C++/Java allows the then- and else-clauses to be either a
5. (a) (4%) C/C++/Java and Perl share similar syntax for an if-then-else statement. However, C/C++/Java allows the then- and else-clauses to be either a single statement or a com- pound statement (using ( )), while Perl requires that all then- and else-clauses must be compound. Provide a reason to justify the Perl design. (b) (6%) What is the output of the following Ruby code? def foo (n) x, y 1, -2 while x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
