2. MAIOR ELEMENTO
void pesquisaMaior(node *LISTA)
{
int maior = LISTA->num;
while(LISTA != NULL)
{
if(LISTA->num > maior)
maior = LISTA->num;
LISTA = LISTA->prox;
}
printf("nO maior elemento da lista é: %d. n", maior);
}
21. MAIOR ELEMENTO
printf("nO maior elemento da lista é: %d. n", maior);
O maior elemento da lista é 10
0 0X1
B 5 0X2
3
10
NU
LL
NU
LL7 0X9
0
10
MAIOR
22. MENOR ELEMENTO
void pesquisaMenor(node *LISTA)
{
LISTA = LISTA->prox;
int menor = LISTA->num;
while(LISTA != NULL)
{
if(LISTA->num < menor)
menor = LISTA->num;
LISTA = LISTA->prox;
}
printf("nO menor elemento da lista é: %d. n", menor);
}
23. MENOR ELEMENTO
LISTA = LISTA->prox;
0 0X1
B 5 0X2
3
10
NU
LL
NU
LL7 0X9
0
0 0X1
B 5 0X2
3
10
NU
LL
NU
LL7 0X9
0