Program, which reads two numbers and displays the quotient obtained after dividing the first number by the second.

import java.io.*;
class quot
{
public static void main(String[] xyz)throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int quot,n1,n2;
double div;
String num;
System.out.println("Enter the first number::");
num=in.readLine();
n1=Integer.parseInt(num);
System.out.println("Enter the second number::");
num=in.readLine();
n2=Integer.parseInt(num);
System.out.println("div="+(double)n1/n2);
System.out.println("quot="+n1%n2);
}
 }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s