Problem : Write a program that divide integer taken from command line as an argument ?
Program :Step 1 - CodingCreate a text file c:\sunilos\Division.java and copy below contents./* * A program which take two integer from command line argument and divide. */ public class Division { public static void main(String[] args) { int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); double div = a/b; System.out.println("Division is " + div); } } Step 2 - Deployment
Step 3 - Testing
OutputIt will display Division is 2.0 <<Previous | Next>> |