---
title: "Discussion on \"Control Structure and Functions in Scala\" | Hashnode"
description: "Discussion on \"Control Structure and Functions in Scala\". Conditional Statements\n if x > 0 then 1 else -1\n val s = if x > 0 then 1 else -1\n\n var t = 0\n if x > 0 then t = 1 else -1\n\n\nInput and Output\n We can read a line of input from the console with the readLine method of the scala.io.StdIn class. To read a..."
url: "https://hashnode.com/posts/control-structure-and-functions-in-scala/64cf0e9279746dd8683c6a8c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Control Structure and Functions in Scala](https://diwashmainali.hashnode.dev/control-structure-and-functions-in-scala?utm_source=hashnode&utm_medium=feed)

Conditional Statements if x > 0 then 1 else -1 val s = if x > 0 then 1 else -1 var t = 0 if x > 0 then t = 1 else -1 Input and Output We can read a line of input from the console with the readLine method of the scala.io.StdIn class. To read a...

Aug 6, 2023 · 3 min read · diwashmainali.hashnode.dev  
Read the article

-   [#scala](https://hashnode.com/tag/scala)
-   [#control-structure](https://hashnode.com/tag/control-structure)
-   [#loops](https://hashnode.com/tag/loops)
-   [#functions](https://hashnode.com/tag/functions)
-   [#functional-programming](https://hashnode.com/tag/functional-programming)

## Written by

[Diwash Mainali](https://hashnode.com/@diwashmainali)

@diwashmainali · Kathmandu, Nepal

  
[View profile](https://hashnode.com/@diwashmainali)

I am currently student who is studying Computer Science who just want's to learn and learn and learn.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
