人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

面接準備

Without Book 質問する

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

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

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

投稿日 Sep 28, 2010 投稿者 Shekhar
回答.
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]);
}
}
投稿日 Sep 28, 2010 投稿者 Arindam Ghosh

回答を入力

名前
メールアドレス
回答
セキュリティチェック
続行するにはこれを解いてください: 8 + 9 = ?
著作権 © 2026、WithoutBook。