Guest User

Untitled

a guest
Jan 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. //if-else-if-else
  2. if(i > j) {
  3. print(i)
  4. } else if(i == j) {
  5. print("Equal")
  6. } else {
  7. print(j)
  8. }
  9.  
  10. //ternary operator, it uses if else
  11. if(i > j) print(i) else print(j)
  12.  
  13. //while loop
  14. while(ctr <= i) {
  15. println(ctr)
  16. ctr += 1
  17. }
  18.  
  19. //for loop
  20. for(a <- ctr to j) {
  21. println(a)
  22. }
Add Comment
Please, Sign In to add comment