Menu
Question Index
...

Write a program to find the two numbers. The difference of those two numbers and the ratio of larger number by smaller number is given.

Input (Integer, Integer) Output (String)
12, 5 LargerNumber = 15.0, SmallerNumber = 3.0
Difference = 15.0 - 3.0 = 12.0
Ratio = 15.0/3.0 = 5.0  
7, 3 LargerNumber = 10.5, SmallerNumber = 3.5
17, 6 LargerNumber = 20.4, SmallerNumber = 3.4
18, 4 LargerNumber = 24.0, SmallerNumber = 6.0
46, 8 LargerNumber = 52.57142857142857, SmallerNumber = 6.571428571428571



class FindNumbersFromDifferenceAndRatio
{
    public static void main(String s[])
    {
        System.out.println(findNumbers(30, 4));

    }


    public static String findNumbers(int difference, double ratioOfLargerBySmaller) {
    }

}

Doubts

Problems

Topic: Basic Arithmetic Operators In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App