-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathFahToCel.java
34 lines (24 loc) · 842 Bytes
/
FahToCel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.Scanner;
public class FahToCel {
public static void main(String[] args) {
// Scanner s = new Scanner(System.in);
// int f = s.nextInt();
// //int cel = (5/9)*(f - 32);
// //int cel = (5 * (f - 32))/9; Gives correct output
//
// int cel = (int)((5.0/9)*(f - 32));
// System.out.println(cel);
System.out.println(9/5); // OUTPUT 1
System.out.println(9.0/5); // OUTPUT 1.8
System.out.println(9 + 5); // OUTPUT 14
System.out.println(9 - 5); // OUTPUT 4
System.out.println(9 / 5); // OUTPUT 1
System.out.println(9 * 5); // OUTPUT 45
System.out.println('a'/3); // OUTPUT 32
System.out.println(9 % 5); // OUTPUT 4
char c = 'a';
char i = (char)(c + 3);
System.out.println(i); // OUTPUT d
System.out.println('a' + 'b'); // OUTPUT 195
}
}