Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. fun max(a:Int,b:Int):Int{ //poner el tipo de dato que va a retornar la función
  2. if (a>b)
  3. return a
  4. else
  5. retunr b
  6. } o
  7.  
  8. fun max(a:Int,b:Int) = if(a>b) a else b
  9.  
  10. fun main(args: Array<String>) {
  11. println(max(4,9)
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement