Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 13th, 2007, 10:17 AM
rsv rsv is offline
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default assignment help needed

hey could someone tell me how i could find out the least number, of the five numbers given by the user???i know i gotta use if then but am not understanding the logic and making things complicated....

rudraraju
 
Old September 13th, 2007, 11:10 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

There are quite afew ways to do this, sort them and take the first/last for instance.

--

Joe (Microsoft MVP - XML)
 
Old September 13th, 2007, 04:00 PM
Authorized User
 
Join Date: Nov 2006
Posts: 93
Thanks: 0
Thanked 1 Time in 1 Post
Default

This sounds like a contest ....

class ConTest
{
  public static void Main(string[] args)
  {
    int Lowest = int.MaxValue;
    int arg;

    for (int i = 0; i < args.Length; i++)
    {
      if (int.TryParse(args[i], out arg))
      {
        Lowest = (Lowest < arg) ? Lowest : arg;
      }
    }

    Console.WriteLine("Lowest number is {0}", Lowest);
  }
}

:-)



What you don't know can hurt you!
 
Old September 14th, 2007, 02:57 PM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

few examples of c#


anita





Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me out with this assignment... vaidehi BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 3 September 10th, 2008 03:57 PM
Illegal Assignment Broodmdh Classic ASP Basics 2 August 22nd, 2008 06:21 AM
assignment pooja85jain SQL Language 1 September 2nd, 2006 11:09 AM
Java assignment greeny Java Basics 0 November 29th, 2005 08:29 AM
Java assignment greeny JSP Basics 0 November 29th, 2005 08:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.