اكثر اسئلة واجوبة المقابلات طلبا والاختبارات عبر الإنترنت
منصة تعليمية للتحضير للمقابلات والاختبارات عبر الإنترنت والدروس والتدريب المباشر

طوّر مهاراتك من خلال مسارات تعلم مركزة واختبارات تجريبية ومحتوى جاهز للمقابلات.

يجمع 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

ادخل اجابتك

الاسم
عنوان البريد الإلكتروني
الاجابة
التحقق الأمني
حل هذا للمتابعة: 3 + 1 = ?
حقوق النشر © 2026، WithoutBook.