ɢօʝօ ɮօƭֆ ռɛƭաօʀᏦ
119 subscribers
11 photos
2 videos
1 file
29 links
Get all news and information regarding updates of all bots under Gojo-Bots here

Gc:- https://t.me/+f_9k8NJDn9M5ZTY9
Download Telegram
Do you guys know? You can find the greater number between two numbers without using if and else.

Formula : (sum of numbers + |difference of number|)/2

|...| represents mod of the difference

#tips
👍1
ɢօʝօ ɮօƭֆ ռɛƭաօʀᏦ
Do you guys know? You can find the greater number between two numbers without using if and else. Formula : (sum of numbers + |difference of number|)/2 |...| represents mod of the difference #tips
Also if u have n numbers u can also find the greatest by performing below method

result = (sum + |diff|)/2

max = (result + |diff between next number and result|)/2

Repeat it until no number is left

For example
let assume I have 3 numbers in variable a, b, c

r = (a + b + |a - b|)/2
max = (r + c + |r - c|)/2

#tips