Most FAQ for automation interview

I just came across the interview when it was asked to write program to take age from user input and display whether it is greater than or less than.


{
   
        int age;
        System.out.println("enter age");
        Scanner objscan = new Scanner(System.in);
        age = objscan.nextInt();
        if(age<18)
            System.out.println("If loop");
        else
        {
            System.out.println("Else ");
        }
           
    }

Comments

Popular Posts