Menu
Topics Index
...
`

Convert from integers to roman numerals


If you need explanation Read this topic

If you need Answer Take test on this topic

Write a program to convert from integers to roman numerals.
Assume that inputs are from 1 to 3999, otherwise return 'Invalid Input'.

Input (Integer) Output (String)
786 DCCLXXXVI
10 X
3 III
501 DI
934 CMXXXIV
-1 Invalid Input
4200 Invalid Input



class ConvertToRomanNumerals
{
    public static void main(String s[])
    {
        System.out.println("Corresponding Roman Numeral of 786 is : " + convertToRomanNumerals(786));

    }


    public static String convertToRomanNumerals(int input) {
    }

}
Topic: Java String Arrays - String Arrays In Java

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

This dose is now closed and the winners are . The 'lucky liker' is Shubham Bansal. Please login into Merit Campus using facebook, to claim your recharge. Go to http://java.meritcampus.com/earnings to raise the recharge.

Posted by Merit Campus    2015-02-24 04:11:58


© meritcampus 2019

All Rights Reserved.

Open In App