Given the integer variables x and y , write a fragment of code that assigns the larger of x and y to another integer variable max.

LANGUAGE: C++

CHALLENGE:

Given the integer variables x and y , write a fragment of code that assigns the larger of x and y to another integer variable max.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. Steve Bobson on June 23, 2015 at 5:00 am

    also works

    max = x>y?x:y;

Leave a Comment

You must be logged in to post a comment.