Skip to content
villares edited this page May 24, 2020 · 4 revisions

Nome

max()

Exemplos

int a = max(5, 9);            // Atribui 9 à "a"
int b = max(-4, -12);         // Atribui -4 à "b"
float c = max(12.3, 230.24);  // Atribui 230.24 à "c"

Descrição

Determina o maior valor entre dois ou três números.

Sintaxe

max(valor1, valor2)
max(valor1, valor2, valor 3)

Parâmetros valor1 int ou float

valor2 int ou float

valor3 int ou float

Retorno

int ou float (dependendo do tipo das entradas)

Utilização

Web & Applicações

Relacionado

min()

Clone this wiki locally