xxxxxxxxxx
fORMULA TO FIND CELSIUS TO fahrenheit .
(32°F − 32) × 5/9 = 0°C
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
#include<iostream>
using namespace std;
void main() {
float C, F;
cout << "Enter temperature in celsius" << endl;
cin >> C;
F = (C * 9 / 5) + 32;
cout << "Temperature in fahrenheit is: " << F << endl;
}
xxxxxxxxxx
(defun farhcelconv()
(format t "Enter degrees in fahrenheit ")
(Let (f)
(setq f (read f))
(APPEND '(celsius is)(*(- f 32)(/ 5 9))')
)
)