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 - Ascending Order Program
Senthilvelan Sambamoorthy
Jul 30
2016
Code
437
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
class
asc
{
public
static
void
main(String arg[])
{
int
a[] = {4,2,1,3,7};
int
i,j,t;
for
(i=0;i<5;i++)
{
for
(j=i+1;j<4;j++)
{
if
(a[i]>a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
for
(i=0;i<5;i++)
{
System.
out
.println(a[i]);
}
}
}
Java
Ascending Order Program