Advertisement
Guest User

chinchin

a guest
Nov 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ChinChin
  4. {
  5. public static void main(String[] args) {
  6. Scanner scan = new Scanner(System.in);
  7. int a = 10;
  8. int b = 30;
  9. System.out.print("Enter x: ");
  10. int x = scan.nextInt();
  11.  
  12. if (x > a && x < b) {
  13. System.out.println("Middle");
  14. } else if (x < a){
  15. System.out.println("Far Left");
  16. } else if (x == a){
  17. System.out.println("Left");
  18. } else if (x > b){
  19. System.out.println("Far Right");
  20. } else if (x == b){
  21. System.out.println("Right");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement