Program in Java to divide two numbers.
import java.util.Scanner; class DivisionDemo { public static void main(String []args) { Scanner cin = new Scanner(System.in); System.out.print("Enter two integer numbers :- "); int x = cin.nextInt(); int y = cin.nextInt(); System.out.println("Division of two integer values = "+(x * y)); System.out.print("\nEnter two floating point numbers :- "); float a = cin.nextFloat(); float b = cin.nextFloat(); System.out.println("Division of two floating point values = "+(a * b)); } }
Output :-
Related Programs
1.
0 Comments