Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //if-else-if-else
- if(i > j) {
- print(i)
- } else if(i == j) {
- print("Equal")
- } else {
- print(j)
- }
- //ternary operator, it uses if else
- if(i > j) print(i) else print(j)
- //while loop
- while(ctr <= i) {
- println(ctr)
- ctr += 1
- }
- //for loop
- for(a <- ctr to j) {
- println(a)
- }
Add Comment
Please, Sign In to add comment