Javatpoint Logo
Javatpoint Logo

F# if-then-else expression

F# if-then-else expression tests the condition. It executes if block if condition is true otherwise else block is executed.

FSHARP If then else expression 1

F# if-then-else Example


It is odd number

F# if-then-else Example: with input from user

In this example, we are getting input from the user by using Console.ReadLine() method. It returns string. For numeric value, You have to convert it into int by using Parse.Int32 method.


Enter a number : 45
It is odd number
Next TopicF# If-elif ladder

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA