Computer Science, asked by shabindhiya, 16 days ago

Write a program to determine the quotient and remainder for integer 17 by 3 ( java program )​

Answers

Answered by purveshKolhe
2

\huge{\red{\overbrace{\underbrace{\mathfrak{\purple{answer::}}}}}}

public class Main {

  public static void main(String [] args) {

     int quotient = 17 / 3;

     int remainder = 17 % 3;

     System.out.println("The quotient is " + quotient + " and remainder is " + remainder);

  }

}

\huge{\blue{\underline{\mathfrak{Logic-}}}}

  • We have declared the class name as "Main".
  • Then there comes the main method which is required in almost every valid java program.
  • We declared two variables - quotient and remainder containing the value of each of the calculation respectively.
  • The we used the println method for printing the text.
  • Always use '/' for getting the quotient, whereas '%' for getting the remainder.

Hope it helps...

Similar questions