A
A
Alexey Fobius2021-08-09 19:32:23
C++ / C#
Alexey Fobius, 2021-08-09 19:32:23

How to make range for values?

I have a variable that changes every second

. So, I need to get the maximum and minimum values ​​​​from it, then find out the average of these numbers

. " is a variable, not a predefined number.

I didn’t find anything sensible, either restrictions on numbers, or searching for numbers in an array

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
edward_freedom, 2021-08-09
@phobious

var твоя_переменная = ;
var min = 0;
var max = 0;
if(твоя_переменная < min) {
    min = твоя_переменная;
}
if(твоя_переменная > max ) {
    max = твоя_переменная;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question