1cels = (fahr - 32.0) * 5.0/9.0; //Fahr to cels
2fahr = (cels * 9.0/5.0) + 32.0; //Cels to fahr
1import java.util.Scanner;
2
3public class Main {
4
5 public static void main(String args[]) {
6 Scanner sc = new Scanner(System.in);
7 int far = sc.nextInt();
8 int cel = (far - 32) * 5/9;
9 System.out.printf("%d Fahrenheit is %d Celsius", far, cel);
10 }
11}
1float cel;
2printf("Enter celsius value: ");
3scanf("%f", &cel);
4
5printf("Fahrenhit value is: %f", cel * (9 / 5) + 32);