Write a Java Program to Compute Quotient and Remainder

Java Program to Compute Quotient and Remainder

Welcome to the World of Online Learning:

Hello Friends “This blog helps you to learn Java programming concepts. You can learn Java  language at your own speed and time. One can learn concepts of Java language by practicing various programs given on various pages of this blog. Enjoy the power of Self-learning using the Internet.”

Java Program to Compute Quotient and Remainder
Java Program to Compute Quotient and Remainder

Write a Java Program to Compute Quotient and Remainder

PROGRAM: Java Program to Compute Quotient and Remainder

/* Java Program to Compute Quotient and Remainder */
public class QuotientRemainder {

  public static void main(String[] args) {

    int dividend = 25, divisor = 4;

    int quotient = dividend / divisor;
    int remainder = dividend % divisor;

    System.out.println("Quotient = " + quotient);
    System.out.println("Remainder = " + remainder);
  }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *