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
Check The Given Number is Odd or Even using Java
Senthilvelan Sambamoorthy
Aug 13
2016
Code
638
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssvoe.rar
// odd or even
import
java.io.*;
class
ssvoe
{
public
static
void
main(String arg[])
throws
IOException
{
String s1;
int
n1;
DataInputStream dr =
new
DataInputStream(System.in);
System.out.print(
"\nEnter the Number : "
);
s1 = dr.readLine();
n1 = Integer.parseInt(s1);
if
(n1 %
2
==
1
)
System.out.println(
"\nThe Number is ODD"
);
else
System.out.println(
"\nThe Number is EVEN"
);
}
}
Java