As part of this topic we will see core language constructs.
Let us see basic programming constructs, such as if else, while loop, for loop etc. As any programming language, Scala also support
- if condition
- ternary operator
- while loop
- for loop
- Arithmetic operations
- Boolean operations
- and more
However we do not use for loop as extensively while dealing with collections, we will see it later.
Task 1 – Factorial
Develop a program which will print factorial of a given number
Task 2 – Fibonacci
Develop a program which will generate number of elements in a Fibonacci series