Write a program to find the sum, difference and product of 15 and 8 using variables with a single System.out.println(); statement, however with horizontal tab space in the result.
Answers
Answered by
1
Answer:
int a=15,b=8;
System.out.println("The sum of a and b is: %d\nThe difference of a and b is: %d\nThe product of a and b is: %d",a+b,a-b,a*b);
Explanation:
Answered by
0
public class Main {
public static void main(String[ ] args) {
int a = 15, b = 8;
System.out.println("Sum - " + (a + b) + "\tDifference - " + (a - b) + "\tProduct - " + (a * b));
}
}
Similar questions