Find X

Report a typo

Write a program that reads three double values a, b, c, and then solves the simple equation:

a * x + b = c

The program should output the value of x.

It's guaranteed that a is not 0.

Sample Input 1:

2 -1 2

Sample Output 1:

1.5
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// put your code here
}
}
___

Create a free account to access the full topic