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
Which template must you provide, in order to display data in a Repeater control? ItemTemplate.To display data in the ItemTemplate, declare one or more Web server controls and s

What is boxing in .net


What is a gateway or Router? A node that is linked to two or more networks is commonly called as router or Gateway. It generally forwards message from single network to another

What is cross page posting? By default, the button controls in the ASP.NET pages post back to the similar page that contains button, where you can write an event handler for th

What are the features of ADO.Net ?  ADO.NET features: 1. Disconnected Data Architecture 2. Data cached in Datasets 3. Data transfer in XML format 4. Interaction wit

URGENTLY WANTED a Web Developer (with solid .NET skills) We are immediately in search of a creative passionate and highly organised expert Web Developer to join our team to work

What is Unicode? In order to understand the concept of Unicode we require  to move a little back and understand the ANSI code. The ASCII (ask key) stands for American Standard

I need C# API for bitfinex Project Description: Hi, I need a developer to build a library in C# that connects to the bitfinex API. The library must implement all the authenti

In this assignment you will create a Windows application that mimic the ILDASM application. Your application should have at least the following features: 1. A multi-form applica