Conditional Statement in SML (if else in SML)

Conditional Statement in SML (if-else in SML)

Like any other programming language, SML also has a conditional statement. Syntax of a conditional statement is:

- if "Condition to be Check" then "True Condition " else "False Condition";

e.g.
- val a=10;
- val b=20;
- if a>b then print("a is greater") else print("b is greater");

Greatest among two screenshots.



Comments

Popular posts from this blog

Print table in SML-NJ

Getting Started with SML