- Go Tutorial
- Go - Home
- Go - Overview
- Go - Environment Setup
- Go - Program Structure
- Go - Basic Syntax
- Go - Data Types
- Go - Variables
- Go - Constants
- Go - Operators
- Go - Decision Making
- Go - Loops
- Go - Functions
- Go - Scope Rules
- Go - Strings
- Go - Arrays
- Go - Pointers
- Go - Structures
- Go - Slice
- Go - Range
- Go - Maps
- Go - Recursion
- Go - Type Casting
- Go - Interfaces
- Go - Error Handling
- Go Useful Resources
- Go - Questions and Answers
- Go - Quick Guide
- Go - Useful Resources
- Go - Discussion
Go Online Quiz
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.
Answer : B
Explanation
No support for type inheritance.
Q 2 - Which of the following is true about packages in Go?
A - The first line of the program package defines the package name in which a Go program should lie.
B - It is a must statement as Go programs runs in packages.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following operator gives remainder of after an integer division in Go?
Answer : B
Explanation
% − Modulus Operator returns remainder of after an integer division.
Q 4 - Which of the following is true about call by reference method of parameter passing in Go?
A - This method copies the address of an argument into the formal parameter.
B - Inside the function, the address is used to access the actual argument used in the call.
Answer : D
Explanation
All of the above options are correct.
Q 5 - Which of the following is the default value of a local variable in Go?
Answer : B
Explanation
Default value of a local variable is 0 type value or nil.
Q 6 - Which of the following is correct about ranges in Go?
A - The range keyword is used in for loop to iterate over items of an array, slice, channel or map.
B - With array and slices, it returns the index of the item as integer.
C - With maps, it returns the key of the next key-value pair.
Answer : D
Explanation
All of the above options are correct.
Q 7 - Which of the following causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating in Go?
Answer : B
Explanation
continue causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.
Q 8 - Which of the following method of parameter passing, copies the address of an argument into the formal parameter?
Answer : B
Explanation
Call by reference − This method copies the address of an argument into the formal parameter.
Answer : B
Explanation
Yes! Structure types are derived types.
Q 10 - An lvalue may appear as either the left-hand or right-hand side of an assignment.
Answer : B
Explanation
An lvalue may appear as either the left-hand or right-hand side of an assignment.
To Continue Learning Please Login
Login with Google