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: Need help to answer questions of VB.NET Skills required are .NET, Software Development, C# Programming, Visual Basic, Windows Desktop


Information Retrieval from Multi-Agent System with Data Mining in Cloud Computing Project Description: I have planned one research model on "Information Retrieval through Mul

You can post back to any of the page and pages in other application, too. But if you are posting pages to other application, the PreviousPage property will return null. This is an

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"


how can i construct er diagram for payroll managment

Compute Average of 3 numbers - C# Program I didn't know the exact code for computing average of integer number. Can anybody suggest me the correct way for find out the average

What are the metrics followed in project management? The most metric sets deal with a variation of these attributes and are chosen to help the project managers gain insight int

What is cloud computing? The cloud computing is the computing which is completely based on the Internet. It can also be explained as the next stage in the evolution of the Inte