Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HelloWorld
- {
- public static void main (String args[]){
- Scanner userInput= new Scanner(System.in);
- int x ;
- System.out.println(" Enter a number ");
- x = userInput.nextInt();
- int y = 8;
- if (x>y){
- System.out.println(x+" is greater than "+y);
- }
- else if (y>x){
- System.out.println(y+" is greater than "+x);
- }
- else{
- System.out.println("Both nums are equal");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement