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 floating type in Go?

A - float128

B - complex64

C - complex128

D - All of the above.

Answer : A

Explanation

float128 is not a floating type.

Answer : C

Explanation

Both of the above options are correct.

Answer : A

Explanation

If you are using nested loops (i.e., one loop inside another loop), the break statement will stop the execution of the innermost loop and start executing the next line of code after the block.

Q 5 - Can you define a pointer to pointer in Go?

A - true

B - false

Answer : A

Explanation

Yes! Go allows you to have pointer on a pointer and so on.

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

A - append()

B - copy()

C - resize()

D - None of the above.

Answer : A

Explanation

Slice allows increasing the capacity of a slice using append() function.

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 - Go supports type inheritance.

A - true

B - false

Answer : B

Explanation

No support for type inheritance.

Q 9 - The first line of the program package defines the package name in which a Go program should lie.

A - true

B - false

Answer : A

Explanation

The first line of the program package defines the package name in which a Go program should lie.

Q 10 - The term rvalue refers to a data value that is stored at some address in memory.

A - true

B - false

Answer : A

Explanation

The term rvalue refers to a data value that is stored at some address in memory.


go_questions_answers.htm

Advertisements