New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
Academic Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
PROSENJIT MANN...
(667)
Lenin
(364)
Mr. Anindya
(293)
Last 7 Days
PROSENJIT MANN...
(1781)
Shobha Manasa
(1774)
Lenin
(1522)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Selection Sort Program - Java
Posted Date: Total Responses:
0
Posted By:
Annapurna
Member Level:
Gold
Points/Cash
: 2
import java.io.*;
public class SelSort {
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the no. of elements: ");
int n = Integer.parseInt(br.readLine());
int a[] = new int[n];
System.out.println("Enter the elements you want to sort: ");
for(int i=0; i
{
a[i] = Integer.parseInt(br.readLine());
}
for(int i=0; i
{
for(int j=i+1; j
{
if(a[i] > a[j])
{
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.println("The sorted array is: ");
for(int i=0; i
{
System.out.print(a[i] + " ");
}
}
}
Project Feedbacks
No feedbacks found. Be the first to respond and make money from
revenue sharing program
.
Post Feedback
You must
Sign In
to post a feedback.
Next Project:
Example of Initialization - Java
Previous Project:
Adding Huge Numbers in C
Return to Project Index
Post New Project
Related Projects
PROGRAM TO FIND THE ROOTS OF EQ. ax^2 + bx + c = 0 .
Find Factorial of a number in HTML using JavaScript
Stack in C
To Understand Variable Scope In PHP
Rank in Red Black Tree
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.