Given Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int N;
String name;
int x;
Scanner input=new Scanner (System.in);
System.out.println("Enter an interger: ");
N=input.nextInt();
System.out.println("Enter the name: ");
name=input.next();
System.out.println("Enter a double number: ");
x=input.nextInt();
double D=N-x;
System.out.println("Hello "+name+" "+"the difference is: "+D);
}
}
Comments
Leave a comment