Share on Google+Share on Google+

sarah joy manimtim
guys,, need help,, in java programing,, arrays
3 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners

create a program where you will input 10 numbers and arrange it in ascending way using arrays.


View Answers

February 17, 2011 at 2:22 PM

Java Input array elements and arrange them in ascending order

import java.util.*;
class ArraySort{
    public static void main(String[] args) {
        Scanner input=new Scanner(;
        System.out.println("Enter Array Elements: ");
        int array[]=new int[10];
        for(int i=0;i<array.length;i++){
        System.out.println("Sorted Array:");
        for(int i=0;i<array.length;i++){

February 20, 2011 at 10:03 AM

it didnt work,, it only copy the input numbers and does not in arrange it in ascending way...

May 20, 2011 at 1:44 PM

it did work... I modified the line:



System.out.print(array[i]) + " "); so it prints in one line... that way I can see the sorted array better

Related Tutorials/Questions & Answers:
guys,, need help,, in java programing,, arrays
guys,, need help,, in java programing,, arrays  create a program where you will input 10 numbers and arrange it in ascending way using arrays
Hey Guys really need to learn - Java Beginners
Hey Guys really need to learn  Im a java beginner and i want to know... u will use scanf(%d%d%d, & month, day, year). How can i do this in java? Someone can help me.. Thank you so much.   Hi Friend, There are lot
Programing Help - Java Beginners
Programing Help  how to design a filebrowser in java "witout using Swing
Java programing help
Java programing help  Can you help me create this program? Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign
arrays help - Java Beginners
arrays help  Write a program that sorts values. ? The program includes readIntegers() that o reads the user inputs o stores them in an array, and o returns the array   ? The program includes easySort() that o sorts
Java programing
Java programing   need help wrting this Write a program that has an array of 5 Strings, and determines which ones are palindromes (letter-case does not matter). thanks
Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks
Need help on JAVA JSP
Need help on JAVA JSP  Hi, I have never worked on java and I have... using JAVA JSP). e.g. Tool does not adjust with the resolution of the screen(need to know how I can adjust it based on the cureen system's screen resolution
Need Help - Java Beginners
Need Help  Hello Sir, Am a beginner of Java. Also i did course... projects in Java as well as J2EE... Can u help me and guide to do a project.../reference/tutorials/ http
need help - Java Beginners
need help  Need help in programming in Java  Simple java program that will show the output within quotes using system.out.println();DISPLAYING OUPUT " * " ," *** " ........I used System.out.print
Need help - Java Beginners
Need help   To Write a Java program that asks the users to enter a m * n matrix of integers, m and n being the number of rows and columns...; Hi Friend, Please try the following code. We hope that this code will help
Need help in java programming
Need help in java programming  Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60% Java program that accepts the following details: student
need help with a program - Java Beginners
Java algorithm - need help with a program  Java algorithm - need help with a program
help with substring in c programing
help with substring in c programing  Hi I could not found programming in C in the "select category" so I am posting my question in java section. Please help with substring function,prompt the user for two strings and display
Need *Help fixing this - Java Beginners
and maybe add retrieve function //need help with this one badly. Thanks guys for all the help. import java.text.*; import javax.swing.*; import java.awt.event....Need *Help fixing this  I need to make this program prompt user
need help with a program - Java Beginners
need help with a program   Part I An algorithm describes how... by the user. The output of the program should be the length and width (entered.... First you would need to make up the "test data". For this algorithm, the test data
java programing
java programing  reverse a multidigit number using recursive definition
java programing
java programing  write a program to input a number or find & print the highest digit
java programing
java programing  write a program to input a number or find & print the highest digit. example:-2639 than print 9
java programing
java programing  Integers from 0 to X stored in an array of size X+1. Each integer appears once & only once, but in random order e.g. Consider array of size 5 as below... Arr[0]=3; Arr[1]=0; Arr[2]=1; Arr[3]=4; Arr[4]=2
Java Programing
Java Programing  I)WAP to print following series: 1) 1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 2) (5!/x)+(10!/xx)+(15!/xx*x)+.....n terms. II)Write a menudriven program to perform the following as long as user
Java Programming Need Help ASAP
Java Programming Need Help ASAP  You are required to develop..., maths mark, communications mark. You will then need accessor and mutator methods... class that creates an array of Students and handles it. You will need
PLZ Need some help JAVA...HELP !!
PLZ Need some help JAVA...HELP !!  Create a class names Purchase Each purchase contains an invoice number, amount of sale and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set
Arrays in java
Arrays in java  what is param array in java
java arrays
java arrays  i need a java program to store student details like id,name,addr,marks,average,total..using arrays..input data using scanner class and by using class, object and constructor
Java with Arrays
Java with Arrays  I was given the assignment to create two parallel arrays; both of size 50 (declares 50 as a constant) One is an array of strings... and store it in the arrays. The input for the problem should be provided in a text
Need help with this!
Need help with this!  Can anyone please help me... for later use. All the students info is put into arrays, but it is not writing to a file at all at this time. Any help would be greatly appreciated, thank you
I need help in doing this. - Java Beginners
I need help in doing this.  Student DataBase i will need creating..., and the student's GPA.using arrays and objects, need to structure the information as follows:The basic data structures being used will be 2 parallel arrays
need help on writing a program. - Java Beginners
Writing first Java Program  Hi, I need help to write my first Java... roseIndia to get your query solved. check given link to see the solution of your Java problem.
java arrays
java arrays  can i know how can we intilize the three dimentional arrays in java? and how can we assign thae values to that array
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized


Advertisement null