Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find the smallest number using while loop in java 2011
#1
Find the smallest number using while loop in java 2011


Code:
import javax.swing.*; public class HighestNum { public static void main (String args[]) { int value = 0,number=0,smallest = 0; while (value<10) { value++; number = Integer.parseInt(JOptionPane.showInputDialog("Enter a number "+value+":")); } if (number <= smallest) smallest=number; else smallest = smallest; String msg="The smallest number is :"+smallest; JOptionPane.showMessageDialog(null,msg); } }

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Variables in function names in php 2011 Vuhelper 1 1,760 08-02-2014, 10:04 AM
Last Post: sadanturk
  PHP Login page and MySql 2011 Vuhelper 1 2,999 08-02-2014, 09:50 AM
Last Post: sadanturk
  Zip code locator issues in php 2011 Vuhelper 2 2,144 08-02-2014, 09:49 AM
Last Post: sadanturk
  checkbox and mysql in php 2011 Vuhelper 0 1,723 09-18-2011, 07:16 PM
Last Post: Vuhelper
  how can Animate your images in PHP 2011-12 Vuhelper 0 2,744 09-12-2011, 10:26 PM
Last Post: Vuhelper
  Radio button selection problem in php 2011-12 Vuhelper 0 1,661 08-27-2011, 09:05 PM
Last Post: Vuhelper
  Moving to preg_replace() from eregi_replace() in php 2011 Vuhelper 0 1,526 07-23-2011, 05:51 PM
Last Post: Vuhelper
  Upload Variables not getting passed in php 2011 Vuhelper 0 1,626 07-23-2011, 05:50 PM
Last Post: Vuhelper
  PHP include instead of iFrame 2011 Vuhelper 0 1,760 07-22-2011, 08:44 PM
Last Post: Vuhelper
  SESSION() and goto support in php 2011 Vuhelper 0 2,154 07-22-2011, 08:42 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)