answersLogoWhite

0

In order to determine which of four number is bigger you need 16 if statements arranged in a nested if statement. That exceeds the complexity of just sorting it in an array. Here is a solution using a simple array sort.

int array[] = {7, 2, 27, 4};

int i, swap;

do {

swap = 0;

for (i = 0; i < 4; ++i) {

if (array[i]<array[i+1]) {

swap=array[i];

array[i]=array[i+1];

array[i+1]=swap;

swap=1;

}

}

} while (swap == 1);

printf ("%d\n", array[0]);

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the composite number bigger than C?

C+1 if C is not composite, and C+2 if C is a composite.


How do you check account holder's name using account number?

how to know a/c holder name by a/c number


If a is bigger than b and b bigger than c which statement must be true?

if a is bigger than b and b is bigger than c a must be bigger than c... Transitivity


What is four times the number of c plus 2 times the number of d?

Four times the number of c plus two times the number of d can be expressed mathematically as (4c + 2d). This expression represents a linear combination of the variables c and d, scaled by their respective coefficients. The resulting value depends on the specific values of c and d.


Are six cups and C pints equal or is six cups bigger and C pints are smaller or C pints are bigger and six cups are smaller?

6 cups are bigger


How many amps in four C batteries in series?

C batteries use 1.5 volts. The number of amps depends on what device it is hooked up to. An average for four C batteries would be about 16 amps.


How do you check subtraction?

If any number B is subtracted from a number A to give C, then C+B =A If A - B = C then B+C = A Eg 7 - 2 = 5 Hence 2 + 5 = 7


Is the airbus a380 bigger than the C-5 Galaxy?

The A380 is bigger but the C-5 is longer


Is d or c bigger in bra size?

D is bigger


What are facts on the viola?

They have four strings. From highest to lowest A D G C which is the same as a cello but higher. They are slightly bigger than violins. Viola music is mainly written in the alto or C clef.


If four more children chose green write a number sentence that tells how many children like green now?

If four more children chose green, a number sentence that tells how many children like green now is: 4+c= _ c= number of children


Which one is bigger 10 degree C OR 23 degree F?

23 is a bigger number than 10.If you want to talk about temperature, there's really no such thing as'bigger' or 'smaller' temperatures.10&Atilde;&sbquo;&Acirc;&deg;C is a 'warmer' temperature, or a 'higher'temperature, than 23&Atilde;&sbquo;&Acirc;&deg;F.But please, not a 'bigger' one.