Computer Science, asked by rahul733, 1 year ago

computer class 9 java

Attachments:

Anonymous: as of class 9th i havent used any class(buffered reader,datainputstream etc)

Answers

Answered by Anonymous
0

class agecheck
{
  public static void main(age)
     {
         
             if(age>=18)
                {
                     System.out.println("ELIGIBLE FOR VOTING");
                      }

               else
                  {
                      System.out.println("NOT ELIGIBLE FOR VOTING");
                  }
           }
}

Anonymous: i have taken input in parameter
Anonymous: i mean i have passed it through parameter
rahul733: bhai inbox me
rahul733: msg me inboc
uashenoy05: ok
Answered by uashenoy05
0
import java.util.*;
public class vote
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a;
System.out.println("enter the age of the person");
n=in.nextInt();
if(n>=18)
System.out.println("This person is eligible to vote");
else
System.out.println("This person cannot vote");
}
}


hope this helped you
pls mark my answer as brainliest

uashenoy05: tnx for marking my answer as brainliest
Similar questions