• Log in or sign up for an account here: https://www.sythe.org/login

:D

PsychicFreak

Member
Joined
Jun 6, 2008
Sythe Gold
0
Messages
53
guys how to make a c program that will get the maximum and minimum number of 5 variables?
 
it will be something like:

Code:
// put in main
int numbers[10]; //array stores the number values
int x;
int highest = 0;
int lowest = 20000;

for (x = 0; x < 10; x++)
{
     if (highest < numbers[x]) highest = numbers[x];
     if (lowest > numbers[x]) lowest = numbers[x];

}

printf("%d %d", highest, lowest);

I'm a newbie in c, but this should work.
 
Runescape Gamblingrunescape gambling
Back
Top