Last active
April 8, 2020 09:26
-
-
Save naijab/abae7c98049a73791da0ff57f31c82c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KiloToMiles { | |
public static void main(String[] args) { | |
double kilometers = 5;//สมมติเป็น 5 กิโลเมตร | |
double miles = kilometers / 1.609; | |
System.out.println(miles); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NumberReverse { | |
public static void main(String[] args) { | |
int number = 123; | |
int number1 = number / 100; | |
int number2 = number % 100 / 10; | |
int number3 = number % 10; | |
System.out.println(number3 + "" + number2 + "" + number1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StudentIdThreeDigits { | |
public static void main(String[] args) { | |
long studentId = 60130803344L; | |
System.out.println(studentId%1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment