Finding maximum & minimum numbers - c# program, DOT NET Programming

Finding Maximum & Minimum Numbers - C# Program

I am facing some problems in the code for Finding Maximum & Minimum Numbers. Can anybody suggest me the proper code for it.

Posted Date: 2/12/2013 12:57:52 AM | Location : United States





This code is appropriate for you, try this..

Program:

using System;

class LargestSmallest

{

public static void Main()

{

int a,b,c,largest,smallest;    

Console.Write("Enter No 1 : ");

a = int.Parse(Console.ReadLine());    

Console.Write("Enter No 2 : ");

b = int.Parse(Console.ReadLine());    

Console.Write("Enter No 3 : ");

c = int.Parse(Console.ReadLine());    

if (a > b)

{

if(a > c)

{

largest = a;

}

else

{

largest = c;

}

}

else

{

if(c>b)

{

largest = c;

}

else

{

largest = b;

}

}  

if (a < b)

{

if(a < c)

{

smallest = a;

}

else

{

smallest = c;

}

}

else

{

if(c<b)

{

smallest = c;

}

else

{

smallest = b;

}

}  

Console.WriteLine("\n\n The Largest Number = " +largest);

Console.WriteLine("\n The Smallest Number = " +smallest);

Console.ReadLine();

}

}

Posted by Aliena | Posted Date: 2/12/2013 1:00:09 AM


Related Discussions:- Finding maximum & minimum numbers - c# program, Assignment Help, Ask Question on Finding maximum & minimum numbers - c# program, Get Answer, Expert's Help, Finding maximum & minimum numbers - c# program Discussions

Write discussion on Finding maximum & minimum numbers - c# program
Your posts are moderated
Related Questions
Project Description: This is an online customization printing system they use for multiple organizations to allow customizing  and access of materials they allocate to drive iss

Web Based Inventory Management System Project Description: I need a build in software which has the subsequent features, if anybody has ready to use web based application, pl

I need asp.net print page task Project Description: I have a little task on asp.net, I need to print a text data to receipt printer from web page, I used the subsequent code

We previously use Site content filtering inside Netkiosk But at present this blocks sites. or keywords We now also require a Whitelist that allows. 1) An entire domain www

What is the use of connection object? The connection objects are used to connect a data to the Command object. 1)An OleDbConnection object is used with the  OLE-DB provider

I need CloudFlare API interface to C# Project Description: We require a small piece of C# .NET code, integrated in an object, that will interface with CloudFlare's API and ge

What is a cloud? A cloud is a combination of hardware, storage, networks, services, and interfaces that helps in delivering computing as a service. It has generally three users

Explain the difference between an ADO.NET Dataset and an ADO Recordset. The two main basic differences between recordset and dataset are as shown below :- 1) With the datase

Develop a Rummikub Game Project Description: I require a game(Rummikub) multiplayer with source codes. I have done to much but i need to help me in Algorithm who can check

What is Thread.Sleep() The Thread's execution can be paused by calling Thread.Sleep method. This Thread.Sleep() method takes an integer value which  determines how long the thr