public class FindLeastAndGreatest
{
public static void main(String[] args)
{
// number can't be equal with each other
int a = 7;
int b = 7;
int c = 6;
System.out.println(least(a,b,c));
System.out.println(greatest(a,b,c));
}
public static int least(int a, int b, int c)
{
int least = 0;
if(a < b && a < c)
{
least = a;
}
else if(b < a && b < c)
{
least = b;
}
else { least = c;}
return least;
}
public static int greatest(int a, int b, int c)
{
int greatest = 0;
if(a > b && a > c)
{
greatest = a;
}
else if(b > a && b > c)
{
greatest = b;
}
else { greatest = c;}
return greatest;
}
}
Subtract the smallest number from the largest number.
The smallest prime number between 0 and 30 is 2, and the largest is 29.
The largest whole number is 3499
Arrange the numbers from smallest to largest and find the middle number.
The smallest two digit number is 00 (a number used as a wire gauge) and the largest is 99, so the difference between the largest and smallest 2-digits numbers is 99 (99 - 00)
The smallest number is 5000 while largest number is 14999.
Use the following algorithm (written in pseudocode). Let largest be the lowest possible real number. Let smallest be the greatest possible real number. Repeat while there is input... { Read real number r from input. If r is greater than largest then let largest be r. If r is less than smallest then let smallest be r. } End repeat. Let range be largest minus smallest. Output range.
Subtract the smallest number from the largest number.
The range of a set of numbers is the range between the largest and the smallest number. This is basically the largest number in the sequence subtract the smallest number in the sequence. In this case, the smallest number is 7 and the largest number is 35. This makes the range 28.
The smallest prime number between 0 and 30 is 2, and the largest is 29.
I guess that the smallest would be zero, if you don't consider negative numbers. There is no largest palindromic number - you can make them as large as you like.
the range
The smallest number would be 29500. The largest number would be 31499.
The largest whole number is 3499
Subtract the smallest number from the largest number and you will get the distance from the smallest number to the largest number. That is the range. Ex: {-2 -4 -6 3 6 7 12} Smallest number is -6, largest number is 12. 12- (-6) = 12 + 6 = 18. The distance from the smallest number to the largest is 16
get the numbers and order them from biggest to smallest.
smallest possible whole number is 6500