Answer to Question #229770 in Java | JSP | JSF for kam

Question #229770

Write a program that prints the sum, difference, product, quotient and remainder of two numbers. Initialize the numbers with the values 44 and 2.


1
Expert's answer
2021-08-25T17:32:21-0400


public class Main
{
 
 public static void main(String[] args) {
    int a=44;
    int b=2;
   
    System.out.println(a + " + " + b + " = " + (a + b));
    
    System.out.println(a + " - " + b + " = " + (a - b));
    
    System.out.println(a + " x " + b + " = " + (a * b));
    
    System.out.println(a + " / " + b + " = " + (a / b));
    
    System.out.println(a + " mod " + b + " = " + (a % b));
 }
 
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS