Write the definition of a method printLarger, which has two int parameters and returns nothing. The method prints the larger value of the two parameters to standard output on a single line by itself.

LANGUAGE: JAVA

CHALLENGE:

Write the definition of a method printLarger, which has two int parameters and returns nothing. The method prints the larger value of the two parameters to standard output on a single line by itself.

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 ,

2 Comments

  1. HC on November 12, 2016 at 4:28 pm

    Can you print this in C code? Thanks. Your answers are always very helpful.

  2. kirk on January 20, 2017 at 12:05 am

    for c

    void printLarger(int a, int b)
    {
    if (a > b){
    printf(“%d\n”, a);
    }
    else {
    printf(“%d\n”, b);
    }
    }

Leave a Comment

You must be logged in to post a comment.