import java.util.Scanner;
public class Division{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int n, d, q;
try{
System.out.print("Enter numerator: ");
n = stdIn.nextInt();
System.out.print("Enter divisor: ");
d = stdIn.nextInt();
q = n / d;
System.out.println(q + "\n");
}
catch(ArithmeticException e){
System.out.println("Error, but keep going anyway,");
}
}//end of main
}//end of Division class
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment