Scala 1
Scala 1
// Question 1
println(if (num > 0) "Positive" else if (num < 0) "Negative" else "Zero")
// Question 2
// Question 3
// Question 4
println(s"Average: $avg")
}
object CombinedScalaProgram {
println("Enter 5 numbers:")
for (_ <- 1 to 5) {
val n = sc.nextInt()
print(s"$a ")
val next = a + b
a=b
b = next
println()