adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Program in Java to Divide two numbers

 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.

Post a Comment

0 Comments