by

1) What is F#?

F# is a functional and cross-platform programming language. F# programming language is used for .Net Framework.

2) What are the features of F#?

The features of F# are:

Net implementation of OCaml

Provides type inference

Rich pattern matching constructs

Interactive scripting and debugging capabilities

Writing higher order functions

3) Write a program in F# to print “F# Expert” by using printfn?

Example:

printfn "F# Expert" 0 1 2 printfn "F# Expert"

4) Write a program in F# to print “Interview Questions” by using System.Console?

Example:

System.Console.WriteLine("Interview Questions") 0 1 2 System . Console . WriteLine ( "Interview Questions" )

5) What are the types of data types used in F#?

Ans: The types of data types used in F# are:

Unit type

Unit type

Derived data types

Primitive data types

6) What are the types of comment in F#?

There are two types of comment in F#:

Single line. Example: // Single Line Comment. Multiple line. Example:(* Multiple Line Comment.*) 0 1 2 3 4 Single line . Example : // Single Line Comment. Multiple line . Example : ( * Multiple Line Comment . * )

7) What is Tuple in F#?

A tuple is a collection of values and the values may be same or different types.

8) What is list in F#?

List is an immutable series of same type of elements.

It is equivalent to linked list data structure to some extent.

9) What is Enumeration in F#?

Enumerations are also known as enums and enum is a combination of labels and values. In place of literals you can use enums to make code more readable and maintainable.

10) What is delegate in F#?

It is a reference type of variable and it holds the reference of a method.

In F# delegates are similar to pointers.

11) What are the types of access control in F#?

There are three types of access control are:

Public

Private

Internal

12) What is Records in F#?

Records: It is used to store any type of data. Here, records are immutable and you can’t change the original records.

13) Can a function return multiple values in F#?

Yes, you can return multiple values in a function by using tuples.

14) What are options in F#?

It is used in calculations when there is a case of exception.

It is also used to indicate whether the function has succeeded or failed.

Option values are of two types:

Some(x)

None

15) What are the various ways of creating lists?

Ways of creating lists are:

By using list literals.

By using cons operator.

By using the List.init method.

By using some syntactic constructs.

16) Who is the developer of F# programming language?

Don Syme is the developer of F# programming language.

17) What are the uses of F# programming language?

The uses of F# programming language are:

It is used for Financial modeling

Graphic design

Compiler programming

Making scientific model

Artificial intelligence research work

Mathematical problem solving

18) Name some reserved keywords available in F#?

Reserved keywords available in F# are:

abstract and as assert base begin do exception extern global class done end false if default downcast else finally inline delegate downto elif function lazy

19) What is the use of delegate keyword in F#?

delegate: It is used to declare a delegate.

20) What is the use of assert keyword in F#?

assert: It is a reserved keyword which is used to verify code during debugging.

21) What is the use of let keyword in F#?

let keyword: This keyword is used for variable declaration in F# programming language.

22) Are variables immutable in F#?

Yes, variables are immutable (once a variable is bound to a value, it canâ€™t be changed.) in F#.

23) Which keyword is used to declare mutable variables in F#?

By using mutable keyword, you can declare mutable variables in F#.

24) What are the types of operators available in F#?

The types of operators available in F# are:

Boolean Operators

Bitwise Operators

Arithmetic Operators

Comparison Operators

25) What is the use of “<>” operator in F#?

“<>” operator: It is a comparison operator which is used to check if the values of two operands are equal or not. If values are not equal then condition becomes true.

26) What are the ways that makes the compiler ignore the escape sequence?

There are two ways makes the compiler ignore the escape sequence:

Using the @ symbol

Enclosing the string in triple quotes

27) What is verbatim string?

verbatim string: A string literal is preceded by the @ symbol, It is known as verbatim string.

28) What are the ways of creating Sets in F#?

The ways of creating Sets in F# are:

By converting sequences and lists to sets.

By creating an empty set using Set.empty and adding items using the add function.

29) Which operator is used to access array elements in F#?

dot operator is used to access array elements in F#.

30) What is Array.rev function?

Array.rev function: It is used to generate a new array by reversing the order of an existing array.

by