Advertisement
kkDav1337

Function Maximum

Jun 28th, 2020
14,248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.23 KB | None | 0 0
  1. function max(num1,num2)
  2.  
  3. if (num1 > num2) then
  4.     result = num1
  5.     else
  6.     result = num2
  7.     end
  8.    
  9.     return result
  10. end
  11.  
  12. print("The maximum of the two numbers is:", max(10,4))
  13. print("The maximum of the two numbers is:", max(3,22))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement