Answer to Question #3558 in Java | JSP | JSF for Y mukundareddy

Question #3558
(1) Write a program to perform all arithmetic operators on the following variables a=5, b=10?
1
Expert's answer
2012-03-16T09:47:48-0400
public class Arifmetic {
public static void main(String[] args){
& int a = 5;
& int b = 10;
& int plus = a+b;
& int minus = a-b;
& int mult = a*b;
& double div = (double) a/b;
& System.out.println(a+" + "+b+" = "+plus);
& System.out.println(a+" - "+b+" = "+minus);
& System.out.println(a+" * "+b+" = "+mult);
& System.out.println(a+" / "+b+" = "+div);
}
}

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
APPROVED BY CLIENTS