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
Colombo
Red Hat Certified System Administrator (RHCSA) - RHEL 10
Sanjeewani95
Updated:
Friday at 7:43 PM
NURSING , CAREGIVER , HOTEL & BEAUTY COURSES
IVA Para Medical Campus
Updated:
Thursday at 9:24 AM
Handmade Character Soft Toys Peppa Pig Family
anil1961
Updated:
Wednesday at 9:58 PM
Ad icon
Video Content Creator
pramukag
Updated:
Jun 28, 2026
Ad icon
QA Engineer Intern
pramukag
Updated:
Jun 28, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
Thread for Programming and Realeted Topics
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="rclakmal" data-source="post: 5976127" data-attributes="member: 98858"><p>Great machan !!! answer is Correct !!!! here is my answer </p><p></p><p>[code]</p><p>/*</p><p> * To change this template, choose Tools | Templates</p><p> * and open the template in the editor.</p><p> */</p><p>package example1;</p><p></p><p>import java.io.BufferedReader;</p><p>import java.io.DataInputStream;</p><p>import java.io.FileInputStream;</p><p>import java.io.IOException;</p><p>import java.io.InputStreamReader;</p><p></p><p>/**</p><p> *</p><p> * @author Lakmal</p><p> */</p><p>class Numbers {</p><p></p><p> static String s = "";</p><p> static String s1 = "";</p><p></p><p> @SuppressWarnings("empty-statement")</p><p> public static void main(String[] args) throws IOException {</p><p> int MAX = 0;</p><p> FileInputStream fis = new FileInputStream("lakmal.txt");</p><p> DataInputStream dis = new DataInputStream(fis);</p><p> BufferedReader bis = new BufferedReader(new InputStreamReader(dis));</p><p> {</p><p> while ((s = bis.readLine()) != null) {</p><p> s1 = s1 + s;</p><p> }</p><p> bis.close();</p><p> System.out.println(s1);</p><p> System.out.println(s1.charAt(0));</p><p> System.out.println(s1.charAt(s1.length() - 1));</p><p> for (int i = 0; i < s1.length() - 4; i++) {</p><p> int value = 1;</p><p> for (int j = i; j < i + 5; j++) {</p><p> value *= Integer.parseInt(Character.toString(s1.charAt(j)));</p><p> }</p><p> if (value > MAX) {</p><p> MAX = value;</p><p> }</p><p> }</p><p> System.out.println(MAX);</p><p> }</p><p></p><p> }</p><p>}</p><p></p><p>[/code]</p><p></p><p>I read that number from a file .that is "lakmal.txt" .........oki !!</p></blockquote><p></p>
[QUOTE="rclakmal, post: 5976127, member: 98858"] Great machan !!! answer is Correct !!!! here is my answer [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package example1; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; /** * * @author Lakmal */ class Numbers { static String s = ""; static String s1 = ""; @SuppressWarnings("empty-statement") public static void main(String[] args) throws IOException { int MAX = 0; FileInputStream fis = new FileInputStream("lakmal.txt"); DataInputStream dis = new DataInputStream(fis); BufferedReader bis = new BufferedReader(new InputStreamReader(dis)); { while ((s = bis.readLine()) != null) { s1 = s1 + s; } bis.close(); System.out.println(s1); System.out.println(s1.charAt(0)); System.out.println(s1.charAt(s1.length() - 1)); for (int i = 0; i < s1.length() - 4; i++) { int value = 1; for (int j = i; j < i + 5; j++) { value *= Integer.parseInt(Character.toString(s1.charAt(j))); } if (value > MAX) { MAX = value; } } System.out.println(MAX); } } } [/code] I read that number from a file .that is "lakmal.txt" .........oki !! [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom