Minimum and maximum
int sum (int min, int max) {return (max-min+1)*(max+min)/2;}
int a, b, c, d, max, min; scanf("%d%d%d%d",&a, &b, &c, &d); (a>b)?(max=a,min=b):(max=b,min=a); (c>d)?(a=c,b=d):(a=d,b=c); max=(a>max)?a:max; min=(b<min)?b:min; printf("%d %d\n", max, min);
#include<stdio.h> int main() { int a[20],min,max; int n; printf("\nEnter the num of elements: "); scanf("%d",&n); printf("Enter the elements\n"); for(int i=0;i<n;i++) { scanf("%d",&a[i]); if(i==0) { min=max=a[i]; } if(a[i]<min) min=a[i]; else if(a[i]>max) max=a[i]; } printf("The largest element is %d. The smallest element is %d.", max, min); }
Use the median-of-three algorithm: int min (int a, int b) { return a<b?a:b; } int max (int a, int b) { return a<b?b:a; } int median_of_three (int a, int b, int c) { return max (min (a, b), min (max (a, b), c)); } Note that the algorithm does not cater for equal values which creates a problem when any two values are equal, because there are only two values to play with, neither of which can be regarded as being the middle value. If the equal value is the lower of the two values, the largest value is returned if and only if it is the last of the three values, otherwise the lowest value is returned. But when the equal value is the larger of the two values, the largest value is always returned. Lowest value is equal: Input: 0, 0, 1 = max (min (0, 0), min (max (0, 0), 1)) = max (0, min (0, 1)) = max (0, 1) = 1 Input: 0, 1, 0 = max (min (0, 1), min (max (0, 1), 0)) = max (0, min (1, 0)) = max (0, 0) = 0 Input: 1, 0, 0 = max (min (1, 0), min (max (1, 0), 0)) = max (0, min (1, 0)) = max (0, 0) = 0 Highest value is equal: Input: 0, 1, 1 = max (min (0, 1), min (max (0, 1), 1)) = max (0, min (1, 1)) = max (0, 1) = 1 Input: 1, 0, 1 = max (min (1, 0), min (max (1, 0), 1)) = max (0, min (1, 1)) = max (0, 1) = 1 Input: 1, 1, 0 = max (min (1, 1), min (max (1, 1), 0)) = max (1, min (1, 0)) = max (1, 0) = 1 The only way to resolve this problem and produce a consistent result is to sum all three inputs then subtract the minimum and maximum values: int median_of_three (int a, int b, int c) { return a + b + c - min (min (a, b), c) - max (max (a, b), c)); } Lowest value is equal: Input: 0, 0, 1 = 0 + 0 + 1 - min (min (0, 0), 1) - max (max (0, 0), 1) = 1 - 0 - 1 = 0 Input: 0, 1, 0 = 0 + 1 + 0 - min (min (0, 1), 0) - max (max (0, 1), 0) = 1 - 0 - 1 = 0 Input: 1, 0, 0 = 1 + 0 + 0 - min (min (1, 0), 0) - max (max (1, 0), 0) = 1 - 0 - 1 = 0 Highest value is equal: Input: 0, 1, 1 = 0 + 1 + 1 - min (min (0, 1), 1) - max (max (0, 1), 1) = 2 - 0 - 1 = 1 Input: 1, 0, 1 = 1 + 0 + 1 - min (min (1, 0), 1) - max (max (1, 0), 1) = 2 - 0 - 1 = 1 Input: 1, 1, 0 = 1 + 1 + 0 - min (min (1, 1), 0) - max (max (1, 1), 0) = 2 - 0 - 1 = 1 This makes sense because when we sort 0, 0, 1 in ascending order, 0 is in the middle, while 0, 1, 1 puts 1 in the middle.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace printnumber { class Program { static void Main(string[] args) { int i; for (i = 0; i < 20; i++) { Console.Write(i); Console.Read(); } } } }
=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)=MAX(Z1:Z10)/MIN(Z1:Z10)
Steps to perform MaxMin on a data set (2,4,6,3,8,1,9,7) are:(2,4,6,3) (8,1,9,7)((2,4)(6,3)) ((8,1)(9,7))In sublist (4,6), max is 6 and min is 4. In sublist (8,9), max is 9 and min is 8.Comparing max and min values of sublist (2,4) and sublist (6,3), value of max is 6 and min is 2.Therefore, for sublist (2,4,6,3) max is 6 and min is 2.Similarly, comparing max and min values of sublist (8,1) and sublist (9,7), value of max is 9 and min is 1.Therefore, for sublist (8,1,9,7) max is 9 and min is 1.Finally, comparing max and min values of sublist (2,4,6,3) and sublist (8,1,9,7), value of max is 9 and min is 1. Steps to perform MaxMin on a data set (2,4,6,3,8,1,9,7) are:(2,4,6,3) (8,1,9,7)((2,4)(6,3)) ((8,1)(9,7))In sublist (4,6), max is 6 and min is 4. In sublist (8,9), max is 9 and min is 8.Comparing max and min values of sublist (2,4) and sublist (6,3), value of max is 6 and min is 2.Therefore, for sublist (2,4,6,3) max is 6 and min is 2.Similarly, comparing max and min values of sublist (8,1) and sublist (9,7), value of max is 9 and min is 1.Therefore, for sublist (8,1,9,7) max is 9 and min is 1.Finally, comparing max and min values of sublist (2,4,6,3) and sublist (8,1,9,7), value of max is 9 and min is 1. Steps to perform MaxMin on a data set (2,4,6,3,8,1,9,7) are:(2,4,6,3) (8,1,9,7)((2,4)(6,3)) ((8,1)(9,7))In sublist (4,6), max is 6 and min is 4. In sublist (8,9), max is 9 and min is 8.Comparing max and min values of sublist (2,4) and sublist (6,3), value of max is 6 and min is 2.Therefore, for sublist (2,4,6,3) max is 6 and min is 2.Similarly, comparing max and min values of sublist (8,1) and sublist (9,7), value of max is 9 and min is 1.Therefore, for sublist (8,1,9,7) max is 9 and min is 1.Finally, comparing max and min values of sublist (2,4,6,3) and sublist (8,1,9,7), value of max is 9 and min is 1. sonika aggarwal GNIIT
it will orbit the sun it self and the sun will keep it in the right spot for its temperature
Max = 700 K, min = 80 K.
Because they obey the same laws (specifically, de Morgan's Laws): -max(a,b) = min(-a,-b) and -min(a,b) = max(-a,-b). In theory, you could use max for intersection and min for union, too.
The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)
int sum (int min, int max) {return (max-min+1)*(max+min)/2;}
int a, b, c, d, max, min; scanf("%d%d%d%d",&a, &b, &c, &d); (a>b)?(max=a,min=b):(max=b,min=a); (c>d)?(a=c,b=d):(a=d,b=c); max=(a>max)?a:max; min=(b<min)?b:min; printf("%d %d\n", max, min);
min: 0.5 KVA MAX: 1.5 KVA
Usually, max 212 F and min 32 F It depends on for what the thermometer will be used. My greenhouse min/max thermometer has a min of -40°F and a max of 120°F A (non-digital) clinical thermometer has a min of 94°F and a max of 108°F A cook's (sugar/jam) thermometer has a min of 100°F and a max of 400°F
The min and max temp of mars i 1,299 degrees celcius and -1,000,000 degrees celcius
#include<stdio.h> int main() { int a[20],min,max; int n; printf("\nEnter the num of elements: "); scanf("%d",&n); printf("Enter the elements\n"); for(int i=0;i<n;i++) { scanf("%d",&a[i]); if(i==0) { min=max=a[i]; } if(a[i]<min) min=a[i]; else if(a[i]>max) max=a[i]; } printf("The largest element is %d. The smallest element is %d.", max, min); }