Computer Science, asked by subanithin, 9 months ago

Java program to divide two numbers(getting input from the user)​

Answers

Answered by Niharikamishra24
0

Answer:

Write a Java program to divide two numbers and print on the screen.

Division is one of the four basic operations of arithmetic, the others being addition, subtraction, and multiplication. The division of two natural numbers is the process of calculating the number of times one number is contained within one another.

Pictorial Presentation:

Java dividing two numbers

mark me as brainlist

Attachments:
Answered by aarvikoberoi2
0

Answer:import java.io.*;

class xyz

{

public static void main(String args[])throws IOException

{

InputStreamReader read=new InputStreamReader(System.in);

BufferedReader in=new BufferedReader(read) ;

int divisor, dividend,ans;

System.out.println("Enter n1");

dividend=Integer.parseInt(in.readLine);

System.out.println("Enter n2");

divisor=Integer.parseInt(in.readLine);

ans=dividend/divisor;

System.out.println("Answer is"+ans);

}

}

Similar questions