0
How can I use only 1 variable to store the results of 5 arithmetic operations to be used inside the System.out.println?
8 Respuestas
0
basically I have the result of five different operations in five different variables. Then the question said I need to use only one variable to store the results of the five operations.
0
and yes I need to store five different results
0
public class ArithmeticOperators {
public static void main(String[] args){
int op1 = 15;
int op2 = 4;
int Sum = op1 + op2;
int Difference = op1 - op2;
int Product = op1 * op2;
int Quotient = op1 / op2;
int Remainder = op1 % op2;
}}
0
Question: use only one variable to store the results of each arithmetic operations to be used inside System.out.println statement
0
Thanks alottt!!!😭 I just found out that the question given to us isn't taught yet. You're a big help😢