DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Arrays

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    27

    Arrays

    Does any know how i can calculate the minimum value of an array of Integers. Thank you for your help and have a happy new year

  2. #2
    Join Date
    Dec 2005
    Location
    New Jersey
    Posts
    290
    Loop through the array and set the lowest to a variable.

    Code:
    Integer[] array = new Integer[num];
    
    // set array values here
    
    int smallest;
    
    for (int i = 1; i < array.length; i++) {
        smallest = Math.min((int) array[i - 1], (int) array[i]);
    }
    
    System.out.println(smallest);

Similar Threads

  1. Control Arrays in VB.NET
    By Gary Nelson in forum .NET
    Replies: 277
    Last Post: 10-01-2003, 12:00 AM
  2. Copy/Duplicate Arrays
    By Steve Cochran in forum .NET
    Replies: 8
    Last Post: 10-18-2002, 12:10 PM
  3. Replies: 15
    Last Post: 05-09-2001, 04:40 AM
  4. VB Arrays and memory allocation
    By Brian Leung in forum VB Classic
    Replies: 12
    Last Post: 06-20-2000, 03:06 PM
  5. VB Arrays and memory allocation
    By Brian Leung in forum VB Classic
    Replies: 0
    Last Post: 06-20-2000, 09:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links