Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ChinChin
- {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int a = 10;
- int b = 30;
- System.out.print("Enter x: ");
- int x = scan.nextInt();
- if (x > a && x < b) {
- System.out.println("Middle");
- } else if (x < a){
- System.out.println("Far Left");
- } else if (x == a){
- System.out.println("Left");
- } else if (x > b){
- System.out.println("Far Right");
- } else if (x == b){
- System.out.println("Right");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement