How to find the Minimum of Three Numbers in Dart - Step by Step Examples
How to find the Minimum of Three Numbers in Dart ?
Answer
To find the minimum of three numbers in Dart, you can use the `min` function from the dart:math library.
✐ Examples
1 Find Minimum of Three Numbers
In this example,
- We import the dart:math library to use the `min` function.
- We declare three variables
a
,b
, andc
with the numbers to compare. - We use the `min` function to compare the numbers and get the minimum.
Dart Program
import 'dart:math';
void main() {
int a = 5;
int b = 8;
int c = 3;
int min = min(min(a, b), c);
print('Minimum of three numbers is: $min');
}
Output
Minimum of three numbers is: 3
Summary
In this tutorial, we learned How to find the Minimum of Three Numbers in Dart language with well detailed examples.