what will be the output of the below program if the input is "khushi" and age is 20
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = scanner.nextLine();
System.out.print("Enter your age: ");
int age = scanner.nextInt();
System.out.println("Hello, " + name + "! You are " + age + " years old.");
if(age=18)
System.out.println("You are eligible for voting");
else
System.out.println("You are not eligible for voting");
}
}




Posted on by