Go Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to Go. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 2 - Which of the following is not a boolean type in Go?

A - true

B - false

C - 0

D - All of the above.

Answer : C

Explanation

0 is not a boolean type.

Q 4 - Can a Go function return multiple values?

A - true

B - false

Answer : A

Explanation

A Go function can return multiple values.

Q 6 - Which of the following function can be used to copy a slice to another slice in Go?

A - append()

B - copy()

C - resize()

D - None of the above.

Answer : B

Explanation

Using copy() function, contents of a source slice are copied to destination slice.

Q 7 - Which of the following method of parameter passing, copies the actual value of an argument into the formal parameter of the function?

A - call by value.

B - call by reference

C - Both of the above.

D - None of the above.

Answer : A

Explanation

Call by value − This method copies the actual value of an argument into the formal parameter of the function.

Q 8 - Which of the following method is the default method of parameter passing in Go?

A - call by value.

B - call by reference

C - Both of the above.

D - None of the above.

Answer : A

Explanation

By default, Go uses call by value to pass arguments.

Q 9 - Package statement is a must statement as Go programs runs in packages.

A - true

B - false

Answer : A

Explanation

Package statement is a must statement as Go programs runs in packages.

Q 10 - An rvalue is an expression that cannot have a value assigned to it which means an rvalue may appear on the right- but not left-hand side of an assignment.

A - true

B - false

Answer : A

Explanation

An rvalue is an expression that cannot have a value assigned to it which means an rvalue may appear on the right- but not left-hand side of an assignment.


go_questions_answers.htm

Advertisements