+ 2
Write a program to accept names of few persons then arrange them in ascending order
6 Réponses
+ 41
can u show the code plzz //☺
edit ::: u must have given the code but its time to go ,
so see this code by Steasy //its also use sort method of array
//u can try more ways , happy coding ☺
https://code.sololearn.com/cdDYwlr48uUJ/?ref=app
+ 36
System.out.print("homework\ndo yourself");
//hint : U can use Array.sort(array name); & many more ways are also available ☺
+ 3
in what order please?
+ 1
I m 16 yrs old and I had tried but the output is not coming
+ 1
Age doesn't matter. My 16 year old could write it in his sleep. Do it in little pieces. Read the names in and print them as you get them. Once that works, change it to read all the names first, followed by print them all. After that works, add the sorting. If a step doesn't work and you can't figure it out, post the code and ask for help.
+ 1
John means:
First create a code hint "loop" to run names and print out it. if it works, go to next step for Arrays
Create a String array, add array to your loop and print out it into loop. If you run names twice, then it works.
Now add array sorting hint "Google".
Then create one more loop to read sorted array
and print out it. hint "for each loop" easier.
Check example Gaurav added.
If it doesn't work, add your last try on code here, then we can help.