Die meistgefragten Interviewfragen und Antworten sowie Online-Tests
Lernplattform fur Interviewvorbereitung, Online-Tests, Tutorials und Live-Ubungen

Baue deine Fahigkeiten mit fokussierten Lernpfaden, Probetests und interviewreifem Inhalt aus.

WithoutBook vereint themenbezogene Interviewfragen, Online-Ubungstests, Tutorials und Vergleichsleitfaden in einem responsiven Lernbereich.

Interview vorbereiten

Without Book Frage stellen

Review the question and existing answers carefully before replying. The best answers explain the reasoning, steps, and tradeoffs so other learners can benefit too.

Frage. Please give me a sorting programming example source code on java.

- Please give me a sorting programming example source code on java.

Veroffentlicht am Sep 28, 2010 Veroffentlicht von Shekhar
Antwort.
import java.io.*;
class sort
{
public static void main(String ar[])throws IOException
{
DataInputStream n=new DataInputStream(System.in);
int temp,i,no,a[]=new int[20];
System.out.println("enter the no. of elements to be sorted not greater than 20");
String lim=n.readLine();
no=Integer.parseInt(lim);
System.out.println("enter the ("+no+") numbers: ");
for(i=0;i {
String q=n.readLine();
a[i]=Integer.parseInt(q);
}

for(i=0;i {
for(int j=i+1;j {
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
System.out.println("the list after sorting is: ");
for(i=0;i System.out.println(" "+a[i]);
}
}
Veroffentlicht am Sep 28, 2010 Veroffentlicht von Arindam Ghosh

Geben Sie Ihre Antwort ein

Vollstandiger Name
E-Mail-Adresse
Antwort
Sicherheitsprufung
Lose dies, um fortzufahren: 5 + 5 = ?
Copyright © 2026, WithoutBook.