Computer Science Fundamentals Software Engineering Objective
Feb 28, 2013

Consider the code below:

             begin
             If (y<=0) then y = 0-y;
             abs = y
             End;

Choose the correct answer:
A) The code is erroneous as negative values remain negative
B) The code finds the absolute value of y always
C) The code is erroneous as positive values become negative
D) a & b both
Detailed Explanation

Option b is right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback