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);
void main() { int a = 5; int b = 7; int c = 2; int res; res = (int)(a/b)?a:b; res = (int)(res/c)?res:c; printf("big num = %d",res); }
#include #include #include int main(int argc, char *argv[]){int n, smallest, largest, sum, temp;if(argc < 2){printf("Syntax: foo val1[val2 [val3 [...]]]\n");exit(1);}smallest = largest = sum = atoi(argv[1]);for(n = 2; n < argc; n++){temp = atoi(argv[n]);if(temp < smallest) smallest = temp;if(temp > largest) largest = temp;sum += temp;}printf("Smallest: %i\nLargest: %i\nAverage: %i\n", smallest, largest, sum / (argc - 1));return 0;}
In Maths, we often talk about ascending and descending order. Ascending order is writing numbers from smallest to largest. Descending order is writing numbers from largest to smallest.
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.
Around your neck. If you need to know the smallest perimeter, then measure around the smallest part of your neck. If you need to know the largest perimeter, then measure around the largest part of your neck. If you need to know the average perimeter, then measure around the smallest part of your neck AND the largest part of your neck, add the numbers together, & then divide that result by 2.
The smallest is 11 and the largest is 97.
The sum of the smallest and largest prime numbers within 10 is 7.
Highlight the numbers and click on the sort button. You can sort ascending (smallest to largest) or descending (largest to smallest).
descending order
Done!
The smallest number is 5000 while largest number is 14999.
Relative
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 difference
The smallest prime number between 0 and 30 is 2, and the largest is 29.
70
The smallest is 0o0'0'' and the largest is 180o0'0''