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
Pure VPN - Up to 27 Months
vgp
Updated:
Today at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Tabloid
The JAVA club
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="rochel1977" data-source="post: 3990465" data-attributes="member: 371"><p>menna magen podi simple program ekak mama liyapu. meka Jcreator wala compile karala balanda. Copy paste karala balanda epa. just type and get the idea.</p><p></p><p>[CODE]</p><p>program that inputs a number and prints whether the number is positive number, negative number or zero. Repeat for 5 numbers.</p><p></p><p>eg1: Numbers.java</p><p></p><p>import java.util.Scanner;</p><p></p><p>public class Numbers</p><p>{</p><p> public static void main (String [] a) </p><p> {</p><p> Scanner input = new Scanner(System.in);</p><p> </p><p> for(int j=0; j<5; j++)</p><p> { </p><p> System.out.println("Enter a number:");</p><p> double n = input.nextDouble();</p><p> </p><p> if(n>0)</p><p> System.out.println(n +" is a positive number");</p><p> else if(n<0)</p><p> System.out.println(n +" is a negative number");</p><p> else</p><p> System.out.println(n +" is a zero number");</p><p> }</p><p> </p><p> System.out.println("Type your name:");</p><p> String name = input.nextLine();</p><p> </p><p> System.out.println("Hello "+ name);</p><p> </p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>errors thibunoth methana post karanda. ekathu wela karamu. <img src="/styles/default/xenforo/smilies/default/yes.gif" class="smilie" loading="lazy" alt=":yes:" title="Yes :yes:" data-shortname=":yes:" /></p></blockquote><p></p>
[QUOTE="rochel1977, post: 3990465, member: 371"] menna magen podi simple program ekak mama liyapu. meka Jcreator wala compile karala balanda. Copy paste karala balanda epa. just type and get the idea. [CODE] program that inputs a number and prints whether the number is positive number, negative number or zero. Repeat for 5 numbers. eg1: Numbers.java import java.util.Scanner; public class Numbers { public static void main (String [] a) { Scanner input = new Scanner(System.in); for(int j=0; j<5; j++) { System.out.println("Enter a number:"); double n = input.nextDouble(); if(n>0) System.out.println(n +" is a positive number"); else if(n<0) System.out.println(n +" is a negative number"); else System.out.println(n +" is a zero number"); } System.out.println("Type your name:"); String name = input.nextLine(); System.out.println("Hello "+ name); } } [/CODE] errors thibunoth methana post karanda. ekathu wela karamu. :yes: [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom