
getting an error
cannot find symbol
import java.util.Scanner;
class Abcd
{
public static void main (String args[])
{
char a;
int b;
Scanner x = new Scanner(System.in);
System.out.println("enter a");
a= x.nextChar();
System.out.println("enter b");
b= x.nextInt();
if ((a=='m')&&(b>=21))
{
System.out.println("You are eligible");
}
else
{
if ((a=='f')&&(b>=18))
{
System.out.println("You are eligible");
}
else
{
System.out.println("You are not eligible or you entered wrong gender");
}
}}}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.