This example will provide how to convert Celsius into Fahrenheit in Java.
Example:
package octopuscodes.com.demo;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Celsius: ");
double celsius = scanner.nextDouble();
double fahrenheit = celsius * 1.8 + 32;
System.out.println("Fahrenheit: " + fahrenheit);
}
}
Output:
Celsius: 100
Fahrenheit: 212.0