Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Monday at 2:42 PM
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sunday at 10:50 AM
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
House Plan
lenura
Updated:
Sep 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri PRO!
Ek Code Chef challenge- Welcome Developers, Hackers & Noobs
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="MihiCherub" data-source="post: 18247320" data-attributes="member: 238676"><p><span style="font-size: 12px">රෙප් නම් එපා බන්..</span> <img src="/styles/default/xenforo/smilies/default/dull.gif" class="smilie" loading="lazy" alt=":dull:" title="Dull :dull:" data-shortname=":dull:" /> <span style="font-size: 12px">කෝඩ් එක එඩිට් කලේ නෑ, උබ හරියට කම්පයිල් කරල නෑ. මම ඔක්කොම දාල තිබ්බෙ..</span> <img src="/styles/default/xenforo/smilies/default/rofl.gif" class="smilie" loading="lazy" alt=":rofl:" title="ROFL :rofl:" data-shortname=":rofl:" /><img src="/styles/default/xenforo/smilies/default/rofl.gif" class="smilie" loading="lazy" alt=":rofl:" title="ROFL :rofl:" data-shortname=":rofl:" /></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">ඔන්න user inputs දාලම තව එකක් ලිව්ව. මේක නම් ide එකෙන් කලේ.. වෙලා නෑ නෝට් පෑඩ් වල කරන්න.</span></p><p></p><p>[PHP]import java.util.Arrays;</p><p>import java.util.InputMismatchException;</p><p>import java.util.Scanner;</p><p></p><p>/**</p><p> *</p><p> * @author Tharindu</p><p> */</p><p>class Numbers {</p><p></p><p> public static void main(String[] args) {</p><p></p><p> Scanner Sc = new Scanner(System.in);</p><p> int lines = 0;</p><p> try {</p><p> System.out.print("How many numbers in the list: ");</p><p> lines = Sc.nextInt();</p><p></p><p> if (lines > 100000) {</p><p> System.out.print("Please Enter value less than 100000");</p><p> return;</p><p> }</p><p></p><p> } catch (InputMismatchException ex) {</p><p> System.out.println("Please Enter valid number: " + ex);</p><p> return;</p><p> }</p><p></p><p> int[] arr = new int[lines];</p><p></p><p> for (int i = 0; i < lines; i++) {</p><p> try {</p><p></p><p> System.out.print("Please Enter your list number: ");</p><p> int num = Sc.nextInt();</p><p> if (num <= 0 || num >= 100000) {</p><p> System.out.println("List number should be between 0 and 100000");</p><p> i--;</p><p> } else {</p><p> arr[i] = num;</p><p> }</p><p></p><p> } catch (InputMismatchException ex) {</p><p> System.out.println("Please Enter valid list number: " + ex);</p><p> return;</p><p> }</p><p> }</p><p></p><p> Arrays.sort(arr);</p><p> System.out.println("Sorted list: ");</p><p> for (int number : arr) {</p><p> System.out.println(number);</p><p></p><p> }</p><p> }</p><p>}[/PHP]</p></blockquote><p></p>
[QUOTE="MihiCherub, post: 18247320, member: 238676"] [SIZE=3][/SIZE][SIZE=3]රෙප් නම් එපා බන්..[/SIZE] :dull: [SIZE=3]කෝඩ් එක එඩිට් කලේ නෑ, උබ හරියට කම්පයිල් කරල නෑ. මම ඔක්කොම දාල තිබ්බෙ..[/SIZE] :rofl::rofl: [SIZE=3] ඔන්න user inputs දාලම තව එකක් ලිව්ව. මේක නම් ide එකෙන් කලේ.. වෙලා නෑ නෝට් පෑඩ් වල කරන්න.[/SIZE] [PHP]import java.util.Arrays; import java.util.InputMismatchException; import java.util.Scanner; /** * * @author Tharindu */ class Numbers { public static void main(String[] args) { Scanner Sc = new Scanner(System.in); int lines = 0; try { System.out.print("How many numbers in the list: "); lines = Sc.nextInt(); if (lines > 100000) { System.out.print("Please Enter value less than 100000"); return; } } catch (InputMismatchException ex) { System.out.println("Please Enter valid number: " + ex); return; } int[] arr = new int[lines]; for (int i = 0; i < lines; i++) { try { System.out.print("Please Enter your list number: "); int num = Sc.nextInt(); if (num <= 0 || num >= 100000) { System.out.println("List number should be between 0 and 100000"); i--; } else { arr[i] = num; } } catch (InputMismatchException ex) { System.out.println("Please Enter valid list number: " + ex); return; } } Arrays.sort(arr); System.out.println("Sorted list: "); for (int number : arr) { System.out.println(number); } } }[/PHP] [/QUOTE]
Insert quotes…
Verification
Nawa warak dahaya keeyada? (Namaya wadi kireema dahaya)
Post reply
Top
Bottom