![Go Tutorial](/go/images/go-mini-logo.jpg)
- 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.
![Questions and Answers](/images/questions_and_answers.png)
Answer : B
Explanation
No support for pointer arithmetic.
Q 2 - Which of the following is correct about lvalue expression in Go?
A - Expressions that refer to a memory location is called "lvalue" expression.
B - An lvalue may appear as either the left-hand or right-hand side of an assignment.
C - Variables are lvalues and so may appear on the left-hand side of an assignment.
Answer : D
Explanation
All of the above are derived types.
Q 3 - Which of the following operator increases integer value by one in Go?
Answer : A
Explanation
++ − Increments operator increases integer value by one.
Q 4 - Which of the following is true about call by value method of parameter passing in Go?
A - This method copies the actual value of an argument into the formal parameter of the function.
B - In this case, changes made to the parameter inside the function have no effect on the argument.
Answer : C
Explanation
Both of the above options are correct.
Q 5 - Which of the following is true about local variables in Go?
A - Variables that are declared inside a function or block are called local variables.
B - They can be used only by statements that are inside that function or block of code.
C - Local variables are not known to functions outside their own.
Answer : D
Explanation
All of the above options are correct.
Q 6 - Which of the following is correct about slices in Go?
A - Go Slice uses array as an underlying structure.
B - len() function returns the elements presents in the slice.
C - cap() function returns the capacity of slice as how many elements it can be accomodate.
Answer : D
Explanation
All of the above options are correct.
Q 7 - Which of the following is correct about type casting in Go?
A - Type casting is a way to convert a variable from one data type to another data type.
B - if you want to store a long value into a simple integer then you can type cast long to int.
Answer : C
Explanation
Both of the above options are correct.
Answer : B
Explanation
No support for operator overloading.
Q 9 - A static type variable declaration requires compiler to interpret the type of variable based on value passed to it.
Answer : B
Explanation
A dynamic type variable declaration requires compiler to interpret the type of variable based on value passed to it.
Q 10 - Variables are rvalues and so may appear on the left-hand side of an assignment.
Answer : A
Explanation
Variables are lvalues and so may appear on the left-hand side of an assignment.
To Continue Learning Please Login