Computer Science, asked by mehak527, 11 months ago

Write a JavaScript code to display the message 'Eligible for voting' in a message box, if the following
conditions are true
1.The age should be >18.
2.The nationality should be Indian​

Answers

Answered by SAC13
5

Answer:

public class vote

{

public class void main ( )

{

int a;

float b;

S.O.P ("enter age

nationality");

Scanner SC=new Scanner (System.in);

a=SC.nextInt( );

b=SC.nextInt( );

if( 18<a) && (b="Indian")

System.out.println("Eligible for voting");

else

System.out.println("not eligible for voting");

}

}

Similar questions