xxxxxxxxxx
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int far = sc.nextInt();
int cel = (far - 32) * 5/9;
System.out.printf("%d Fahrenheit is %d Celsius", far, cel);
}
}
xxxxxxxxxx
(°C × 9/5) + 32 = °F
1) Multiply celcius value to 9
2)divide that by 5
3)Add 32 to the answer
4) BOOM thats uranswer in Farenheit
xxxxxxxxxx
//Create a program that will be able to accept
//a Temperature in Fahrenheit and Print its Equivalent Temperature in celcius.
//The Formula for Converting Fahrenheit to Celcius is C=5/9(F-32)
//Where C is Equivalent to Celcius and F is for Fahrenheit.
#include<stdio.h>
main()
{
float c,f;
printf("Input The Fahrenheit: ");
scanf("%f",&f);
c=((f-32)*5)/9;
printf("The Converted Celcius is: %f",c);
}
xxxxxxxxxx
(defun farhcelconv()
(format t "Enter degrees in fahrenheit ")
(Let (f)
(setq f (read f))
(APPEND '(celsius is)(*(- f 32)(/ 5 9))')
)
)