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
Medical related application in .NET (document, Videos editing must) Project Description: I am seeking a .NET Web application which can do the subsequent: 1. Taking patient

In this task, you are required to create an Account Management application with Web Form. Your Account Management application must have the following pages: 1.  Create an accoun

What is "Common Language Runtime" (CLR)?  CLR is .NET equivalent of Java Virtual Machine (JVM). It is the runtime that changes a MSIL code into the host machine language code,

How to use a checkbox in a datagrid? The steps to be done are as follows:- 1)    In the ASPX page you have to add Itemtemplate tag in datagrid. 2) I

Question: (a) List and describe the four parameters contained in the second section of the AdRotator Scheduler File. (b) Distinguish between the following types of "Locks"

Job Portal A one-stop explanation to all your needs. Consist of employee as well as employer login accounts. Employee capable to look for jobs. Employer capable to post jobs.

Explain Forms authentication in detail. In the old ASP if you were said to create a login page and do authentication you have to do lot of custom coding. But now in ASP.NET tha

Could you please explain to me the different types of DOT NET programming

I need a POS like openbravo Project Description: i want a POS like openbravo in .net with sql azure and c#. Must be designed also for touch screen.  Web platform Also m

Develop a scrapebox software Project Description: I need a software name scrapebox Skills required are .NET, C Programming, Java, C# Programming, Software Architecture