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
Calculate reverse the give number using Java
Senthilvelan Sambamoorthy
Aug 13
2016
Code
534
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssvrev.rar
// reverse the number
import
java.io.*;
class
ssvrev
{
public
static
void
main(String args[])
throws
IOException
{
int
num;
BufferedReader ip =
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.println(
"\n\t\t\tREVERSING THE GIVEN DIGIT"
);
System.out.print(
"\n\n\tNumber: "
);
num = Integer.parseInt(ip.readLine());
System.out.print(
"\n\n\n\t\tReversed Didits: "
);
do
{
int
t = num %
10
;
System.out.print(t);
num = num /
10
;
}
while
(num>
0
);
System.out.println();
}
// end of main function
}
// end of class
Java