TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java - If else Statement
Senthilvelan Sambamoorthy
Aug 20
2016
Code
638
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssvif.rar
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"
);
}
}
Java