PandA-2024.02
documentation
tutorial_isc_2023
01-introduction
Exercise2
solution
minmax.c
Go to the documentation of this file.
1
void
min_max
(
int
*
input
,
int
num_elements,
int
*
max
,
int
*
min
)
2
{
3
int
local_max = input[0];
4
int
local_min = input[0];
5
int
i = 0;
6
for
(i = 0; i < num_elements; i++)
7
{
8
if
(input[i] > local_max)
9
{
10
local_max = input[i];
11
}
12
else
if
(input[i] < local_min)
13
{
14
local_min = input[i];
15
}
16
}
17
*min = local_min;
18
*max = local_max;
19
}
input
int input[SIZE]
Definition:
hash.h:1
min
#define min(x, y)
max
#define max
Definition:
backprop.h:17
min_max
void min_max(int *input, int num_elements, int *max, int *min)
Definition:
minmax.c:1
Generated on Mon Feb 12 2024 13:02:47 for PandA-2024.02 by
1.8.13