import java.io.*;
class ssvif
{
public static void main(String arg[]) throws IOException
{
System.out.print("Enter your age in completed years: ");
DataInputStream dr = new DataInputStream(System.in);
String t;
t = dr.readLine();
int age = Integer.parseInt(t);
if(age >= 18)
System.out.println("\nyou are eligible to cast your vote");
else
System.out.println("\nyou have to wait for " + (18-age) + " years");
}
}In this program, I will explain about if statement using Java Program.
