﻿ C# Sharp exercises: Find the largest and lowest values from three integer values - w3resource

# C# Sharp Exercises: Find the largest and lowest values from three integer values

## C# Sharp Basic: Exercise-39 with Solution

Write a C# program to find the largest and lowest values from three integer values.

Sample Solution:

C# Sharp Code:

``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Exercise39 {
static void Main(string[] args)
{
Console.WriteLine("\nInput first integer:");
Console.WriteLine("Input second integer:");
Console.WriteLine("Input third integer:");

Console.WriteLine("Largest of three: "+Math.Max(x, Math.Max(y, z)));
Console.WriteLine("Lowest of three: "+Math.Min(x, Math.Min(y, z)));
}
}
``````

Sample Output:

```Input first integer:
15
Input second integer:
25
Input third integer:
30
Largest of three: 30
Lowest of three: 15
```

Flowchart:

C# Sharp Code Editor:

Improve this sample solution and post your code through Disqus

What is the difficulty level of this exercise?

﻿

New Content: Composer: Dependency manager for PHP, R Programming