Computer Science, asked by Abhishek1234Mahor, 9 months ago

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 krpalashish842
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 Oreki
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