answersLogoWhite

0

import java.io.* ;

public class Roman

{

public static void main(String[] args)throws IOException

{

InputStreamReader reader = new InputStreamReader(System.in) ;

BufferedReader br = new BufferedReader (reader) ;

System.out.print("Enter any decimal number between 1 and 59 : ") ;

int n = Integer.parseInt(br.readLine()) ;

String c[] = {"I","II","III","IV","V","VI","VII","VIII","IX","X","L"} ;

String s = "" ;

int t ;

if(n <= 10)

System.out.println("The number '"+n+"' in ROMAN notation is '"+(c[n-1])+"'") ;

else if(n > 10 && n <= 59)

{

int y = n/10 ;

int r = n%10 ;

if(y 0)

s = s+c[10] ;

}

else

{

if(r!=0)

s = s+c[r-1] ;

}

System.out.println("The number '"+n+"' in ROMAN notation is '"+s+"'") ;

}

else

System.out.println("!! FATAL ERROR !! [ No. Greater than 59 ] ") ;

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

What are 2 parts of a 2 part drill command?

A two-part drill command consists of the preparatory command and the command of execution. The preparatory command indicates the movement to be performed, such as &quot;Forward.&quot; The command of execution follows and directs the action, like &quot;March.&quot; Together, they guide the unit in executing a specific drill maneuver.


What is a command sequence?

A command sequence is an ordered set of instructions or commands executed by a computer or a program to perform a specific task. It can involve various operations, such as data manipulation, control flow, and interaction with hardware or software components. Command sequences are fundamental in programming and scripting, allowing for automation and efficient execution of complex processes.


What does smeac stand for?

SMEAC stands for Situation, Mission, Execution, Administration, and Command. It's a framework used primarily in military planning and briefings to structure communication and ensure all critical aspects of a mission are covered. Each component provides essential information: the current situation, the mission objectives, the execution plan, administrative details, and command structure. This method enhances clarity and efficiency in conveying plans and orders.


What is difference between assert and verify commands?

Assert command checks whether the given condition is true or false. Let's say we assert whether the given element is present on the web page or not. If the condition is true then the program control will execute the next test step but if the condition is false, the execution would stop and no further test would be executed.coming to verify command, it is also checks whether the given condition is true or false. Irrespective of the condition being true or false, the program execution doesn't halts i.e. any failure during verification would not stop the execution and all the test steps would be executed. Source : I am senior programmer @ quontra solutions


Which command is used to clear the command window of Matlab?

CLC is the command used for this purpose. CLC clears the command window and homes the cursor

Related Questions

Write a program that converts a decimal number to crossponding string .Decimal Number is accepted as command line input at the time of execution?

#include #include using std::cout;using std::cin;using std::endl;using std::string;int main(){string myNumber = "";cout myNumber;cout


Metacharacter indicates background command execution?

The ampersand (&amp;) puts any command in the background to start execution.


How can I programmatically stop a MATLAB script execution using a single command in MATLAB?

To programmatically stop a MATLAB script execution using a single command, you can use the &quot;return&quot; command. This command will immediately exit the current function or script, effectively stopping its execution.


What are the two parts of a drill command?

A drill command typically consists of two parts: the preparatory command and the command of execution. The preparatory command alerts the unit to get ready for the movement or action, while the command of execution signals when to carry out the action. For example, in the command &quot;Forward, march,&quot; &quot;Forward&quot; is the preparatory command, and &quot;march&quot; is the command of execution. Together, these parts ensure clear communication and coordination during drills.


What command system is a widely used and accepted tool for command and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What is instruction execution?

The definition of instruction execution is the process of carrying out an instruction by a computer. This is what was formerly known as a command execution in DOS.


What is the preparatory command for left face?

The prepatory command is "left" while the command of execution is "face."


What command system is a widely used and accepted tool for control command and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What command tool is widely used and accepted tool for command control and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What command system is a widely used and a accepted tool for command controls and coordination of a response to a disaster?

Incident Command System is a widely used and accepted tool for command, control, and coordination of a disaster response.


What are 2 parts of a 2 part drill command?

A two-part drill command consists of the preparatory command and the command of execution. The preparatory command indicates the movement to be performed, such as &quot;Forward.&quot; The command of execution follows and directs the action, like &quot;March.&quot; Together, they guide the unit in executing a specific drill maneuver.


Which command continuous the program whose execution was temporarily terminated in Gw basic?

In GW-BASIC, the command used to continue a program whose execution was temporarily terminated is CONT. This command resumes the execution from the point where the program was interrupted, allowing the user to continue running the program without restarting it from the beginning. It's typically used after a STOP statement or when execution is paused.